16.9 C
London
Thursday, May 16, 2024

Newest updates for watch faces on Put on OS



Posted by Anna Bernbaum – Product Supervisor, and Garan Jenkin – Developer Relations Engineer

Ultimately 12 months’s Google I/O, we launched the Watch Face Format for Put on OS. This 12 months, as a part of our continued partnership with Samsung, we’re excited to share some new options that you should utilize to create thrilling new watch face designs! These options are actually supported in XML definitions, and later within the 12 months, you’ll additionally see an replace to Watch Face Studio to benefit from them.

The Watch Face Format is the really useful technique to create watch faces for Put on OS. The format makes it simpler to create customizable and extra power-efficient watch faces for gadgets that run Put on OS 4 or increased. The Watch Face Format is a declarative XML format, so there isn’t any executable code concerned in making a watch face, and there’s no code embedded in your watch face APK.

Moreover, in our transfer towards the Watch Face Format for watch face creation, we have now additionally made some modifications to look at face growth.

New options within the Watch Face Format

Flavors

Flavors characterize preset configurations in your watch face, out there within the companion app:

Watch gallery

They permit the watch face developer to configure helpful and enticing combos of the watch face’s configuration choices, and permit the person to visualise and choose from these with ease.

We’ve now introduced flavors to the Watch Face Format. For a full information on including them to your watch face, see the flavors reference.

Issues

We’re including help for each “objective progress” and “weighted parts” complication varieties to the Watch Face Format:

circle chart with data saying 60% of goal progress and weight elements circle chart

    • Objective progress is ideal for information the place the person has a goal, however that concentrate on might be exceeded. A very good instance is step rely.
    • Weighted parts can characterize discrete subsets of knowledge, exhibiting their relative sizes, the place you may in any other case use one thing like a pie chart.

Each of those complication varieties might be accessed by means of the [COMPLICATION.*] expression object. For full particulars, see the complication steerage.

Climate

Figuring out at-a-glance what the climate might be like for the subsequent hour, day, and past could make all of the distinction to a person’s plans! Unsurprisingly, having climate information as a knowledge supply within the Watch Face Format has been a standard request, and we’re delighted to have the ability to introduce it on this newest model. You’ll now have the ability make watch faces like this:

circle chart with data saying 60% of goal progress and weight elements circle chart

Climate Fundamentals

Climate within the Watch Face Format is accessed through the [WEATHER.*] expression object. You should use it in Situation and textual content Template statements and wherever the place expressions are supported.

For instance, to indicate the present climate situation, use this template and expression:

<Template>Present climate situations: %s
    <Parameter expression="[WEATHER.CONDITION_NAME]"/>
</Template>

The climate supplier within the Watch Face Format helps a variety of various metric varieties for the present day, together with the next:

    • Present situations
    • Temperature – present, minimal (low), and most (excessive)
    • UV index
    • Likelihood of rain

For the total vary of knowledge varieties and situations, see the climate information.

Forecasts

Along with the present climate, you’ll be able to entry forecast information, each by hour and by day. For instance, to entry the forecast most temperature for tomorrow, use a template and set of expressions just like the next:

<Template>Tomorrow max temp: %d°%s
    <Parameter expression="[WEATHER.DAYS.1.TEMPERATURE_HIGH]" />
    <Parameter expression="[WEATHER.TEMPERATURE_UNIT] == 1 ? &quot;C&quot; : &quot;F&quot;" />
</Template>

When utilizing climate within the Watch Face Format, there are some additional particulars to pay attention to, comparable to checking for forecast availability or loading errors. For all of this and extra, check out the climate information.

Adjustments to Watch Face growth

As we collect momentum behind the Watch Face Format, we’re asserting some modifications to current watch face growth choices.

We introduced lately that just some problems might be out there on Put on OS 5, for watch faces constructed with AndroidX or the Wearable Assist Library. This restriction doesn’t apply to look at faces that use the Watch Face Format.

Moreover, beginning in early 2025 (particular date to be introduced in This autumn 2024), all new watch faces revealed on Google Play should use the Watch Face Format. Current watch faces that use different libraries, comparable to AndroidX or the Wearable Assist Library, can proceed to obtain updates with out transitioning to the brand new format.

New sources

To make it simpler to create watch faces utilizing the Watch Face Format, we’ve revealed some extra sources on GitHub.

You now have full entry to the XSD specification, that can assist you construct your individual watch face producing instruments.

We’ve additionally offered validators to test your XML for correctness and reminiscence utilization. These are the identical checks run by Google Play, so it lets you run these checks even earlier than you submit your watch face for publishing.

Be taught extra

Get began with the newest model of the Watch Face Format.

You’ll want to try Constructing for the way forward for Put on OS technical session and What’s new in Put on OS at I/O 2024 weblog put up to be taught extra about all the newest updates for Put on OS!

Code snippets license:

Copyright 2023 Google LLC.
SPDX-License-Identifier: Apache-2.0
Latest news
Related news

LEAVE A REPLY

Please enter your comment!
Please enter your name here