21.1 C
New York
Sunday, June 8, 2025

What’s new in Watch Faces



What’s new in Watch Faces

Posted by Garan Jenkin – Developer Relations Engineer

Put on OS has a thriving watch face ecosystem that includes a wide range of designs that additionally goals to attenuate battery affect. Builders have embraced the simplicity of making watch faces utilizing Watch Face Format – within the final 12 months, the variety of revealed watch faces utilizing Watch Face Format has grown by over 180%*.

Right now, we’re persevering with our funding and saying model 4 of the Watch Face Format, out there as a part of Put on OS 6. These updates permit builders to specific even higher ranges of creativity via the brand new options we’ve added. And we’re supporting marketplaces, which provides flexibility and management to builders and extra selection for customers.

On this weblog submit we’ll cowl key new options, take a look at the documentation for extra particulars of adjustments launched in current variations.

Supporting marketplaces with Watch Face Push

We’re additionally saying a totally new API, the Watch Face Push API, geared toward builders who wish to create their very own watch face marketplaces.

Watch Face Push, out there on gadgets working Put on OS 6 and above, works completely with watch faces that use the Watch Face Format watch faces.

We’ve partnered with well-known watch face builders – together with Facer, TIMEFLIK, WatchMaker, Pujie, and Recreative – in designing this new API. We’re excited that each one of those builders might be bringing their distinctive watch face experiences to Put on OS 6 utilizing Watch Face Push.

Three mobile devices representing watch face marketplace apps for watches running Wear OS 6

From left to proper, Facer, Recreative and TIMEFLIK watch faces have been growing market apps to work with watches working Put on OS 6.

Watch faces managed and deployed utilizing Watch Face Push are all written utilizing Watch Face Format. Builders publish these watch faces in the identical means as publishing via Google Play, although there are some extra checks the developer should make that are described within the Watch Face Push steering.

A flow diagram demonstrating the flow of information from Cloud-based storage to the user's phone where the app is installed, then transferred to be installed on a wearable device using the Wear OS App via the Watch Face Push API

The Watch Face Push API covers solely the watch a part of this typical market system diagram – because the app developer, you might have management and duty for the telephone app and cloud parts, in addition to for constructing the Put on OS app utilizing Watch Face Push. You’re additionally answerable for the phone-watch communications, for which we suggest utilizing the Knowledge Layer APIs.

Including Watch Face Push to your mission

To start out utilizing Watch Face Push on Put on OS 6, embrace the next dependency in your Put on OS app:

// Guarantee newest model is utilized by checking the repository
implementation("androidx.put on.watchface:watchface-push:1.3.0-alpha07")

Declare the required permission in your AndroidManifest.xml:

"com.google.put on.permission.PUSH_WATCH_FACES" />

Receive a Watch Face Push shopper:

val supervisor = WatchFacePushManagerFactory.createWatchFacePushManager(context)

You’re now prepared to begin utilizing the Watch Face Push API, for instance to listing the watch faces you might have already put in, or add a brand new watch face:

// Listing current watch faces, put in by this app
val listResponse = supervisor.listWatchFaces()

// Add a watch face
supervisor.addWatchFace(watchFaceFileDescriptor, validationToken)

Understanding Watch Face Push

Whereas the fundamentals of the Watch Face Push API are straightforward to grasp and entry via the WatchFacePushManager interface, it’s essential to think about a number of different components when working with the API in follow to construct an efficient market app, together with:

    • Setting energetic watch faces – By way of a further permission, the app can set the energetic watch face. Find out about easy methods to combine this characteristic, in addition to easy methods to deal with the totally different permission eventualities.

To study extra about utilizing Watch Face Push, see the steering and reference documentation.

Updates to Watch Face Format

Pictures

Out there from Watch Face Format v4

The brand new Pictures ingredient permits the watch face to comprise user-selectable photographs. The ingredient helps each particular person photographs and a gallery of photographs. For a gallery of photographs, builders can select whether or not the photographs advance robotically or when the person faucets the watch face.

a wearable device and small screen mobile device side by side demonstrating how a user may configure photos for the watch face through the Companion app on the mobile device

Configuring photographs via the watch Companion app

The person is ready to choose the photographs of their selection via the companion app, making this a good way to incorporate true personalization in your watch face. To make use of this characteristic, first add the required configuration:


  "myPhoto" configType="SINGLE"/>

Then use the Pictures ingredient inside any PartImage, in the identical means as you’d for an Picture ingredient:


  "[CONFIGURATION.myPhoto]"
          defaultImageResource="placeholder_photo"/>

For particulars on easy methods to assist a number of photographs, and easy methods to configure the totally different change behaviors, discuss with the Pictures part of the steering and reference, in addition to the GitHub samples.

Transitions

Out there from Watch Face Format v4

Watch Face Format now helps transitions when exiting and coming into ambient mode.

moving image demonstrating an overshoot effect adjusting the time on a watch face to reveal the seconds digit

State transition animation: Instance utilizing an overshoot impact in revealing the seconds digits

That is achieved via the prevailing Variant tag. For instance, the hours and minutes within the above watch face are animated as follows:


  "AMBIENT" goal="x" worth="100" interpolation="OVERSHOOT" />

   

By default, the animation takes the complete extent of allowed time for the transition. The brand new interpolation attribute controls the animation impact – on this case using OVERSHOOT provides a playful expertise.

The seconds are applied in a separate DigitalClock ingredient, which exhibits using the brand new period attribute:


  "AMBIENT" goal="alpha" worth="0" period="0.5"/>
   

The period attribute takes a worth between 0.0 and 1.0, with 1.0 representing the complete extent of the allowed time. On this instance, by utilizing a worth of 0.5, the seconds animation is faster – taking half the allowed time, compared to the hours and minutes, which take the complete transition interval.

For extra particulars on utilizing transitions, see the steering documentation, in addition to the reference documentation for Variant.

Shade Transforms

Out there from Watch Face Format v4

We’ve prolonged the usefulness of the Remodel ingredient by permitting colour to be reworked on nearly all of parts the place it’s an attribute, and likewise permitting tintColor to be reworked on Group and Half* parts corresponding to PartDraw and PartText.

The principle exceptions to this addition are the clock parts, DigitalClock and AnalogClock, and likewise ComplicationSlot, which don’t at present assist Remodel.

Along with extending the listing of transformable attributes to incorporate colours, we’ve additionally added a handful of helpful features for manipulating colour:

To see these in motion, let’s take into account an instance.

The Climate information supply offers the present UV index via [WEATHER.UV_INDEX]. When representing the UV index, these values are usually additionally assigned a colour:

moving image demonstrating an overshoot effect adjusting the time on a watch face to reveal the seconds digit

We wish to symbolize this data as an Arc, not solely displaying the worth, but additionally utilizing the suitable colour. We will obtain this as follows:

"0" centerY="0" peak="420" width="420"
  startAngle="165" endAngle="165" course="COUNTER_CLOCKWISE">
  "endAngle"
    worth="165 - 40 * (clamp(11, 0.0, 11.0) / 11.0)" />
  "20" colour="#ffffff" cap="ROUND">
    "colour"
      worth="extractColorFromWeightedColors(#97d700 #FCE300 #ff8200 #f65058 #9461c9, 3 3 2 3 1, false, clamp([WEATHER.UV_INDEX] + 0.5, 0.0, 12.0) / 12.0)" />
  

Let’s break this down:

    • The primary Remodel restricts the UV index to the vary 0.0 to 11.0 and adjusts the sweep of the Arc based on that worth.
    • The second Remodel makes use of the brand new extractColorFromWeightedColors perform.
        • The first argument is our listing of colours
        • The second argument is an inventory of weights – you may see from the chart above that inexperienced covers 3 values, whereas orange solely covers 2, so we use weights to symbolize this.
        • The third argument is whether or not or to not interpolate the colour values. On this case we wish to stick strictly to the colour conference for UV index, so that is false.
        • Lastly within the fourth argument we coerce the UV worth into the vary 0.0 to 1.0, which is used as an index into our weighted colours.

The consequence appears like this:

side by side quadrants of watch face examples showing using the new color functions in applying color transforms to a Stroke in an Arc

Utilizing the brand new colour features in making use of colour transforms to a Stroke in an Arc.

In addition to with the ability to present uncooked colours and weights to those features, they can be used with values from issues, corresponding to HR, temperature or steps objective. For instance, to make use of the colour vary laid out in a objective complication:

"colour"
    worth="extractColorFromColors(
        [COMPLICATION.GOAL_PROGRESS_COLORS],
        [COMPLICATION.GOAL_PROGRESS_COLOR_INTERPOLATE],
        [COMPLICATION.GOAL_PROGRESS_VALUE] /    
            [COMPLICATION.GOAL_PROGRESS_TARGET_VALUE]
)"/>

Introducing the Reference ingredient

Out there from Watch Face Format v4

The brand new Reference ingredient permits you to discuss with any transformable attribute from one a part of your watch face scene in different elements of the scene tree.

In our UV index instance above, we’d additionally just like the textual content labels to make use of the identical colour scheme.

We might carry out the identical colour rework calculation as on our Arc, utilizing [WEATHER.UV_INDEX], however that is duplicative work which might result in inconsistencies, for instance if we modify the precise colour hues in a single place however not the opposite.

Returning to the Arc definition, let’s create a Reference to the colour:

"0" centerY="0" peak="420" width="420"
  startAngle="165" endAngle="165" course="COUNTER_CLOCKWISE">
  "endAngle"
    worth="165 - 40 * (clamp(11, 0.0, 11.0) / 11.0)" />
  "20" colour="#ffffff" cap="ROUND">
    "colour" identify="uv_color" defaultValue="#ffffff" />
    "colour"
      worth="extractColorFromWeightedColors(#97d700 #FCE300 #ff8200 #f65058 #9461c9, 3 3 2 3 1, false, clamp([WEATHER.UV_INDEX] + 0.5, 0.0, 12.0) / 12.0)" />
  

The colour of the Arc is calculated from the comparatively advanced extractColorFromWeightedColors perform. To keep away from repeating this elsewhere in our watch face, we’ve got added a Reference ingredient, which takes as its supply the Stroke colour.

Let’s now have a look at how we will devour this worth in a PartText elsewhere within the watch face. We gave the Reference the identify uv_color, so we will merely discuss with this in any expression:

"0" y="225" width="450" peak="225">
  "225" centerY="0" width="420" peak="420"
    startAngle="120" endAngle="90"
    align="START" course="COUNTER_CLOCKWISE">
    "SYNC_TO_DEVICE" dimension="24">
      "colour" worth="[REFERENCE.uv_color]" />
      
    
  


Consequently, the colour of the Arc and the UV numeric worth at the moment are coordinated:

side by side quadrants of watch face examples showing Coordinating colors across elements using the Reference element

Coordinating colours throughout parts utilizing the Reference ingredient

For extra particulars on easy methods to use the Reference ingredient, discuss with the Reference steering.

Textual content autosizing

Out there from Watch Face Format v3

Typically the precise size of the textual content to be proven on the watch face can range, and as a developer you wish to steadiness with the ability to show textual content that’s each legible, but additionally full.

Auto-sizing textual content may also help resolve this downside, and could be enabled via the isAutoSize attribute launched to the Textual content ingredient:

"CENTER" isAutoSize="true">

Having set this attribute, textual content will then robotically match the out there area, beginning on the most dimension laid out in your Font ingredient, and with a minimal dimension of 12.

For example, step rely might vary from tens or lots of via to many 1000’s, and the brand new isAutoSize attribute allows finest use of the out there area for each potential worth:

side by side examples of text sizing adjustments on watch face using isAutosize

Making the most effective use of the out there textual content area via isAutoSize

For extra particulars on isAutoSize, see the Textual content reference.

Android Studio assist

For builders working in Android Studio, we’ve added assist to make working with Watch Face Format simpler, together with:

    • Run configuration assist
    • Auto-complete and useful resource reference
    • Lint checking

That is out there from Android Studio Canary model 2025.1.1 Canary 10.

Study Extra

To study extra about constructing watch faces, please check out the next assets:

We’ve additionally lately launched a codelab for Watch Face Format and have up to date samples on GitHub to showcase new options. The concern tracker is accessible for offering suggestions.

We’re excited to see the watch face experiences that you simply create and share!

Discover this announcement and all Google I/O 2025 updates on io.google beginning Might 22.

* Google Play information for interval 2025-03-24 to 2025-03-23

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles