There’s a great deal happening here, but it isn't too daunting when we break it lower just a little.
In
onCreate() we build the WatchFaceStyle which specifies some fundamental
conduct in our watch face - for example whether or not this should
receive touch occasions, how big notification card ‘peeks’ etc. Within
our situation app developer would like small ‘peeks’ since the watch face is
text-based and getting text-based look cards overlaying the timepiece
face in ambient mode really doesn’t work nicely. We’re not supporting
touch occasions, so we shouldn't clutter the display with system UI
time. Next we initialise three colour values for that background colour
(an in-depth crimson), the ambient background colour (black), and also
the text colour (white-colored). Finally we produce a new TextLayout
object - more about this within the next article.
The following
method, onApplyWindowInsets(), will get known as using the dimension
from the overall surface that will generally be visible towards the
user. What we should need here's to find out if the device includes a
round or square face as our positioning computations will vary with
respect to the face shape. We produce a new InsetCalculator which is
accustomed to aid positioning from the text.
onPropertiesChanged()
will get known as using the hardware qualities from the device inside a
Bundle. Within our situation we’re thinking about
PROPERTY_LOW_BIT_AMBIENT which signifies if the screen switches to less
bits for every colour value when it's in ambient mode. App developer make use of
this to disable anti-aliasing when switching to ambient way of products
supporting low bit ambient mode.
Next we've
onAmbientModeChanged() which will get known as once the device makes its
way into or exits ambient mode. For individuals not really acquainted
with ambient mode it's a low-power mode which supplies an ‘always on’
display, but implements a significantly less detailed display which
doesn't update as often as the primary display.
No comments:
Post a Comment