Wear Watchface
Note: The Watch Face Format is required for watch faces to be installed on devices with Wear OS 5 or later pre-installed and for all new watch faces published on Google Play.
Starting in January 2026, the Watch Face Format will be required for watch faces to be installed on all Wear OS devices.
Learn more about the user-facing changes in this Help Center article.
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| April 23, 2025 | 1.2.1 | - | - | 1.3.0-alpha07 |
Declaring dependencies
To add a dependency on Wear, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { // Use to implement wear watchfaces implementation "androidx.wear.watchface:watchface:1.2.1" // Use to implement wear watchface complications implementation "androidx.wear.watchface:watchface-complications-data-source:1.2.1" // (Kotlin-specific extensions) implementation "androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1" // Use to implement a watchface style and complication editor implementation "androidx.wear.watchface:watchface-editor:1.2.1" // Can use to render complications. // This library is optional and watchfaces may have custom implementation for rendering // complications. implementation "androidx.wear.watchface:watchface-complications-rendering:1.2.1" }
Kotlin
dependencies { // Use to implement wear watchfaces implementation("androidx.wear.watchface:watchface:1.2.1") // Use to implement wear watchface complications implementation "androidx.wear.watchface:watchface-complications-data-source:1.2.1" // (Kotlin-specific extensions) implementation "androidx.wear.watchface:watchface-complications-data-source-ktx:1.2.1" // Use to implement a watchface style and complication editor implementation("androidx.wear.watchface:watchface-editor:1.2.1") // Can use to render complications. // This library is optional and watchfaces may have custom implementation for rendering // complications. implementation "androidx.wear.watchface:watchface-complications-rendering:1.2.1" }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
Version 1.3
Version 1.3.0-alpha07
April 23, 2025
androidx.wear.watchface:watchface-*:1.3.0-alpha07 is released. Version 1.3.0-alpha07 contains these commits.
New Features
- It’s been possible to define a watch face’s UserStyle schema for a while, and it’s possible to define
ColorUserStyleSettingin XML.
API Changes
- Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed. (Idb6b5)
- Added the Watch Face Push API which allows a Wear OS app to install a watch face on a watch programmatically.
Bug Fixes
- Complication providers using 1.3.0-alpha06 are encouraged to upgrade because a crash bug with
ComplicationDataSourceUpdateRequesteron the next version of WearOS has been fixed.
Version 1.3.0-alpha06
March 26, 2025
androidx.wear.watchface:watchface-*:1.3.0-alpha06 is released. Version 1.3.0-alpha06 contains these commits.
New Features
- The wear watchface APIs (watchface, watchface-client, watchface-client-guava, watchface-complications-rendering, watchface-data, watchface-editor, watchface-editor-guava, and watchface-style) have been depreciated in favor of the Wear Watchface Format, and will eventually be removed from AndroidX. The complication APIs are not deprecated and will remain. (Ice960)
- The complication APIs are now able to communicate with
WearSDKdirectly, which is more efficient due to fewer IPC hops.
Version 1.3.0-alpha05
January 15, 2025
androidx.wear.watchface:watchface-*:1.3.0-alpha05 is released. Version 1.3.0-alpha05 contains these commits.
New Features
Watch faces commonly allow the user to select colors using a ListUserStyle. While this works, it entails sending the icons over bluetooth to the companion editor which is inefficient, so we’ve introduced ColorUserStyleSetting where the payload is a list of one or more color per style which has a significantly more compact wire format.
We’ve added an OEM facing feature which allows OEM complication providers to add extras to ComplicationData for use by OEM watch faces.
API Changes
UserStyleSettingandUserStyleOptionclasses now have builders which is the recommended way to construct them. (Iacd03)- Support for passing extras in
ComplicationData. This is intended for use by OEMs where they control both the complication provider and the receiving watch face. Setting an extra requires the privilegedcom.google.android.wearable.permission.COMPLICATION_EXTRASpermission. (I4e3b2) - Watch faces commonly allow the user to select colors using a
ListUserStyle, with an icon for eachListOption. SinceUserStyleschemas are sent over bluetooth, it is important to keep the size of the schema down which can be a problem if many dozens of color options are given due to all those icons. To help with this we've addedColorUserStyleSettingwhere the option contains a list of colors instead of an icon, which is much more compact. (Ib542e) ColorUserStyleSettingandColorOptionrequire API 34 for use. (I8771d)
Bug Fixes
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage:
-Xjspecify-annotations=strict(this is the default starting with version 2.1.0 of the Kotlin compiler). (Ifd363, b/326456246)
Version 1.3.0-alpha04
September 18, 2024
androidx.wear.watchface:watchface-*:1.3.0-alpha04 is released. Version 1.3.0-alpha04 contains these commits.
New Features
- Added support for lazy loading of icons in
UserStyleSettingsandUserStyleOptionswhich is a performance win for loading watch faces. (Iaf43d) - Added an option for an updated screenshot to be taken whenever the system configuration changes (e.g. if the locale changed) via the new
Watchface.setUpdateScreenshotOnConfigurationChange. By default this setting is off. (I765a1)
Bug Fixes
- Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (e.g. R8 version 3.3) and for all builds when using AGP 8.1 or later (e.g. D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. See this article for more details. (Ia60e0, b/345472586)
Version 1.3.0-alpha03
April 17, 2024
androidx.wear.watchface:watchface-*:1.3.0-alpha03 is released. Version 1.3.0-alpha03 contains these commits.
API Changes
- We've added
EditorSession#setOverrideComplicationswhich temporarily sets the underlying watchface instance'sComplicationDatawhile editing. If complications change infrequently, this is more efficient than passing overrides in viaEditorSession#renderWatchFaceToBitmap. (I19384)
Bug Fixes
- Previously
selectComplicationDataForInstantwas callingtoApiComplicationDatafor any timelines, meaning the subsequent === reference equality test would always fail. This meant complications were getting reloaded every frame leading to battery drain. (717406)
Version 1.3.0-alpha02
April 3, 2024
androidx.wear.watchface:watchface-*:1.3.0-alpha02 is released. Version 1.3.0-alpha02 contains these commits.
New Features
- We now use reference equality to compare best and
selectedDatabecause the equals operator is expensive. (446b00)
API Changes
- We’ve added a no-fallback dynamic API for
GoalProgressComplicationData. (c33264)
Version 1.3.0-alpha01
February 7, 2024
androidx.wear.watchface:watchface-*:1.3.0-alpha01 is released. Version 1.3.0-alpha01 contains these commits.
New Features
WatchFaceServicescan be initialized concurrently and as such they should be stateless, to support this we’ve addedStatefulWatchFaceServicein which a user defined extra created bycreateExtra()is passed into all the overrides called during initialization.GlesRenderer2now has a constructor overload which lets you specify a list of attributes to try in turn witheglChooseConfig.
API Changes
StatefulWatchFaceServicenow supports an override ofgetComplicationSlotInflationFactoryinto which the user-defined extra created bycreateExtra()is passed. (I82d9f)- Some watch faces need to share auxiliary data created during
createUserStyleSchemawith the other initialisation methods. Because there wasn't a better alternative, developers typically made theirWatchFaceServicesstateful. This is dangerous because multiple instances can be created concurrently which can lead to bugs. To resolve this we've introducedStatefulWatchFaceServiceandStatefulWatchFaceRuntimeServicewhere a user defined type is created bycreateExtra()and is passed to the various create methods as a parameter. (If8a99) - We've added
getUserStyleFlavorstoInteractiveWatchFaceClient, which is of interest primarily for OEMs. (I0f5d8) GlesRenderer2now has a constructor overload which lets you specify a list of attributes to try in turn witheglChooseConfig. This for example allows you to first try a config with anti-aliasing and to fallback to one without if needed. (I1ba74)- From Android U, support for
SystemDataSources.DATA_SOURCE_HEART_RATEwill be added to WearOS. This complication is only guaranteed to supportSHORT_TEXTcomplications, but it's recommended for theComplicationSlotto acceptSMALL_IMAGEtoo because OEMs may choose to serve a shortcut to their health app instead of the live value. (I34223) - We've added
METADATA_KEY_CONFIG_RESTORE_SUPPORTEDwhich from Android U onwards, controls what happens when the system is restored from a backup for complication data source withMETADATA_KEY_DATA_SOURCE_CONFIG_ACTION. By default the system assumes that the complication data source service supports backup of any configuration data, but if it does not then it can add metadata settingMETADATA_KEY_DATA_SOURCE_CONFIG_ACTIONto false which will mark the complication slot as not configured. (I6c505)
Version 1.2
Version 1.2.1
January 24, 2024
androidx.wear.watchface:watchface-*:1.2.1 is released. Version 1.2.1 contains these commits.
Bug Fixes
- Fixed a crash on Samsung Galaxy Watch 4, 5 & 6. (43f0b0)
Version 1.2.0
November 29, 2023
androidx.wear.watchface:watchface-*:1.2.0 is released. Version 1.2.0 contains these commits.
Important changes since 1.1.0
- We’ve added support some new complication types which are available for use from Android T:
GoalProgressComplicationDatawhich is similar toRangedValueComplicationDataexcept it's for progress towards a goal where min implicitly is zero, and the value is allowed to be larger thantargetValue.WeightedElementsComplicationDatawhich consists of an array of Elements (pairs of weight and color) along with optional text/title/image. These might be displayed as a pie chart where the colors need to be meaningful given the context, since there typically isn't room in a complication to render labels.
- We’ve added support for optional
ColorRangestoRangedValueComplicationData. Normally complications would be rendered in colors of the watch face's choosing, but sometimes theComplicationDataSourceis best placed to set the colors e.g. when they have a particular semantic meaning. E.g. red to blue for temperature. - Almost every type of
ComplicationDatanow supportsSmallImages. - We've added
ComplicationDisplayPolicywhereDO_NOT_SHOW_WHEN_DEVICE_LOCKEDinstructs a compatible watch face to not display the complication when the device is locked. - From Android T, OEMs will be able to determine if a complication request is from a watch face in the list defined by the
android.support.wearable.complications.SAFE_WATCH_FACESmetadata in their provider’s manifest byComplicationRequest#isForSafeWatchFace. The provider will need thecom.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACEpermission to receive anything other than TargetWatchFaceSafety.UNKNOWN`. UserStyleFlavorshas become a non-experimental feature.
Version 1.2.0-rc01
October 18, 2023
androidx.wear.watchface:watchface-*:1.2.0-rc01 is released. Version 1.2.0-rc01 contains these commits.
Version 1.2.0-beta02
September 6, 2023
androidx.wear.watchface:watchface-*:1.2.0-beta02 is released. Version 1.2.0-beta02 contains these commits.
New Features
SuspendingComplicationDataSourceService#onDestroyis now open. Please note support for a system default weather complication has been removed.
API Changes
- Revert "Expose a new data source for weather complications". (I6f335)
Version 1.2.0-beta01
August 23, 2023
androidx.wear.watchface:watchface-*:1.2.0-beta01 is released. Version 1.2.0-beta01 contains these commits.
New Features
- From Android T, WearOS will now support a default weather system complication.
API Changes
- Add weather default system fallback for complications. (Ia0994)
- This patch adds
WatchFaceRuntimeServiceandWatchFaceControlClient.createWatchFaceRuntimeControlClientalong with guava wrappers. These add support for watch face runtimes which are a special kind of watch face that loads it's definition from another package. Currently WearOS only supports the runtime for the Android Watch Face Format. (I2799f) - This patch is a follow up to aosp/2636578 where we rename the int defs so any code depending on
WatchFaceType,CanvasType,TapTypeorComplicationsSlotBoundsTypedoesn't need to change. (I4098b) - Updated API files to annotate compatibility suppression. (I8e87a, b/287516207)
- This patch exposes
WatchFaceTypeconstants inWatchFaceTypes,CanvasTypeconstants inCanvasTypes,TapTypeconstants inTapTypesandComplicationsSlotBoundsTypeconstants inComplicationsSlotBoundsType. (I3b85a, b/288750666) WatchFace.OverlayStylehas very low usage and is not well supported by OEMs so we're depreciating it with intention to remove it at a later date. (I7344a)
Version 1.2.0-alpha09
June 21, 2023
androidx.wear.watchface:watchface-*:1.2.0-alpha09 is released. Version 1.2.0-alpha09 contains these commits.
New Features
RangedValueComplicationData.Buildernow acceptsDynamicFloat, and a newDynamicComplicationTextis available as a subclass ofComplicationText, both of which can utilize dynamic expressions as well as platform bindings that are updated at 1hz on supported Wear 4 devices.
API Changes
- Added dynamic types for daily distance, daily calories and daily floors. Keys for platform health sources are now under
PlatformHealthSources.Keys(Ib7637) - Implement
PlatformDataProviderto provide heart rate and daily steps.SensorGatewayinterface is removed from public API. (I55b84) - Rename
StateEntryValuetoDynamicDataValue, and update the state APIs to use theDynamicDataKey. (If1c01) - Add
AppDataKeyfor accessing app pushed state; AddPlatformDataKeyfor accessing platform data; Add namespace support inStateStore. (I7985e) enable/disablePlatformSourcemethods have been removed fromDynamicTypeEvaluator. The caller should be responsible for updates. (I78c6d)- Allow capping the size of bound data types. (Ie2966)
Version 1.2.0-alpha08
April 19, 2023
androidx.wear.watchface:watchface-*:1.2.0-alpha08 is released. Version 1.2.0-alpha08 contains these commits.
New Features
- From Android T, complication providers with the privileged
com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACEmay registerandroidx.wear.watchface.complications.datasource.SAFE_WATCH_FACE_SUPPORTED_TYPESmetadata which overridesandroid.support.wearable.complications.SUPPORTED_TYPESfor safe watch faces. This means a complication provider may choose to serve different types to trusted vs untrusted watchfaces.
API Changes
- Propagation of
@Deprecatedclass to property (I882d1, b/271441831) - Value parameter name for
Enum.valueOfchanged (Ia9b89) - More thrown exceptions from enum valueOf (I818fe)
- We've removed
renderWatchFaceToSurfacein favour ofcreateRemoteWatchFaceViewwhich is built on top of SurfaceControlViewHost and allows the caller to embed a view from the watch face, which is rendered when the client callsRemoteWatchFaceViewHost#renderWatchFace. (Ib311d) - We've added
renderWatchFaceToSurfacetoInteractiveWatchFaceClient,HeadlessWatchFaceClientandEditorSession. Typically this will be more performant than rendering to a bitmap. (Ieacad) ObservableStateStorehas been rename toStateStore. (Ieb0e2)- Added
DynamicTypeEvaluator.Builderinstead of constructor arguments to allow more optional arguments, includingObservableStateStorewhich now defaults to an empty store. (I6f832) - Refactored order of parameters in
DynamicTypeEvaluator. (Ic1ba4) - Executor has been added to the
DynamicTypeEvaluator.bindmethods. (I346ab) - We have added
startEvaluationmethod to theBoundDynamicTypeto trigger the evaluation after dynamic type is bound. (I19908) - Complication providers with the privileged
com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACEmay registerandroidx.wear.watchface.complications.datasource.SAFE_WATCH_FACE_SUPPORTED_TYPESmetadata which overridesandroid.support.wearable.complications.SUPPORTED_TYPESfor safe watch faces. (Id1c73) - We've renamed
CustomValueUserStyleSettings2toLargeCustomValueUserStyleSettings. (Ic17ac)
Bug Fixes
DynamicTypeValueReceiver#onPreUpdatehas been removed. (I2dc35)
Version 1.2.0-alpha07
February 22, 2023
androidx.wear.watchface:watchface-*:1.2.0-alpha07 is released. Version 1.2.0-alpha07 contains these commits.
New Features
From Android T, OEMs will be able to determine if a complication request is from a watch face in the list defined by the
android.support.wearable.complications.SAFE_WATCH_FACESmetadata in their provider’s manifest byComplicationRequest#isForSafeWatchFace. The provider will need thecom.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACEpermission to receive anything other thanTargetWatchFaceSafety.UNKNOWN.Also from Android T
CustomValueUserStyleSetting2is available for use which can hold up to 12.5kb. The previous limit forCustomValueUserStyleSettingwas 1kb. Despite the increased size limits, watch face developers are encouraged to keep the data small because the settings get sent over bluetooth during editing and bluetooth bandwidth is limited.
API Changes
- We've added an optional parameter
eglContextAttribListtoGlesRenderer&GlesRenderer2which allows you to set theEGL14.EGL_CONTEXT_CLIENT_VERSIONpassed toEGL14.eglCreateContext. (I2a83e) - We've migrated watch face libs over to
androidx.core.util.Consumerinstead ofjava.util.function.Consumer. (I273f5) - More thrown exceptions from KT property accessors (Iff9d9)
- We've added
InteractiveWatchFaceClient.isComplicationDisplayPolicySupportedso that the client can determine if it has to emulate support or not on behalf of old watch faces. (I24c89) - We've decided that
isForSafeWatchFaceshould be a tri-stateIntDef. (Ief2f7) - For android T we've introduced
ComplicationRequest.isForSafeWatchFacewhich is intended for OEM use and it requirescom.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACE. For data sources in the system image, this will return true if the requesting watch face is inside the list of safe watchfaces specified by the data source in it's manifest. (I0cbb6) - For android T we've added
CustomValueUserStyleSetting2which can hold up to 12.5kb. The previous limit forCustomValueUserStyleSettingwas 1kb. (I0b100)
Version 1.2.0-alpha06
January 25, 2023
androidx.wear.watchface:watchface-*:1.2.0-alpha06 is released. Version 1.2.0-alpha06 contains these commits.
New Features
- Work is ongoing to add support for complication platform bindings, this isn’t ready for use yet, but stay tuned!
- We’ve added XML
ComplicationSlotsupport for the new complication types, GOAL_PROGRESS and WEIGHTED_ELEMENTS.
Bug Fixes
- Fixes a leak where the watch face editor was not properly released on Samsung devices. (3b5987)
- Fixes a bug where sometimes the complications didn’t display properly when switching between a watch face with multiple favorites. (b38ece)
- Fixes a serialization bug with perOptionScreenReaderNames that lead to watch face crashes. (e9f466)
Version 1.2.0-alpha05
December 7, 2022
androidx.wear.watchface:watchface-*:1.2.0-alpha05 is released. Version 1.2.0-alpha05 contains these commits.
New Features
A while back we added support for hierarchical
UserStyleSettings, and from android T it’s now possible to have more than oneComplicationSlotsUserStyleSettingin a hierarchy. Only oneComplicationSlotsUserStyleSettingwill be active, based on the user’s style selections.We’re improving screen reader support for
ListOptionandComplicationSlotsOptionby adding ascreenReaderNamefield, note prior to android T this field will be ignored by companion editors.
API Changes
- We've added a new optional
screenReaderNamefield toListOptionandComplicationSlotsOptionfor use by editors - will be ignored by companion editors on devices before android T. (I75326) - From android T multiple
ComplicationSlotsUserStyleSettingsare now supported in a style hierarchy as long as at most only one of them can be active at any one time. We've added a utility functionfindComplicationSlotsOptionForUserStyletoUserStyleSchemato help find the activeComplicationSlotsOptionif any. (Ic2b06) RangedValuesTypeshave been pulled intoRangedValueComplicationData's companion object and renamed toTYPE_UNDEFINED,TYPE_RATINGand a newTYPE_PERCENTAGEhas been added. (I55d02)- We've renamed experimental
DynamicFloattoFloatExpressionand marked it as@hide. (Idf4f1) - Adding
@JvmDefaultWithCompatibilityannotation (I8f206)
Version 1.2.0-alpha04
November 9, 2022
androidx.wear.watchface:watchface-*:1.2.0-alpha04 is released. Version 1.2.0-alpha04 contains these commits.
New Features
- For Android T we’ve added support for two new complication types,
GoalProgressComplicationDataandWeightedElementsComplicationData. GoalProgressComplicationDatais similar toRangedValueComplicationDatabut it’s value is allowed to go past the target (forRangedValueComplicationDatathe value is clamped to the range [min .. max]) which has implications for visual design that might not suit all watch faces.GoalProgressComplicationDataadds support for pie charts and similar breakdowns of simple data.- We’ve added optional support for
ColorRampstoRangedValueComplicationData. - For Android T, We've added
ComplicationPersistencePolicyandsetCachePolicytoComplicationDatawhich currently allows a provider to control whether a complication is persisted or not (i.e. whether it's cached past reboot). Most complications won't need to set cache control, but doing so can fix corner cases with stale data for some complications that update frequently (e.g. health data complications). We've also addedComplicationDisplayPolicywhereDO_NOT_SHOW_WHEN_DEVICE_LOCKEDinstructs a compatible watch face to not display the complication when the device is locked. (Ic9574)
API Changes
GoalProgressComplicationData,WeightedElementsComplicationDataandColorRampare no longer experimental. (Ica9e2)ComplicationPersistencePolicyandComplicationDisplayPolicyare now properly marked as T APIs. (I31d88)- The deprecated
ComplicationSlotOverlayconstructor now hasDeprecationLevel.WARNINGallowing it to be called from java once again. (Ib308c) - We've fixed some java compat issues with
ComplicationRequestListener,CanvasComplication,ComplicationTapFilterandInteractiveWatchFaceClientby annotating them with@JvmDefaultWithCompatibility(Id94fc) - We've removed experimental
ProtoLayoutComplicationDataandListComplicationData. The developer story for these was unclear, we hope to revisit in future. (I9df05) - We've added a
ValueTypeback toRangedValueComplicationData.WeightedElementsComplicationDatanow supports a background color. We've removedDiscreteRangedValueComplicationDatabecause it's functionality is a subset ofWeightedElementsComplicationData. (I6446c)
Bug Fixes
- Include the
isForScreenShotin the equals and hash code. Make sure theonRenderParametersChangedgets a correctisForScreenshotvalue (I04a41) - Fixed leaks of
WatchFaceControlServicefrom headless clients. (e90e00)
Version 1.2.0-alpha03
October 5, 2022
androidx.wear.watchface:watchface-*:1.2.0-alpha03 is released. Version 1.2.0-alpha03 contains these commits.
New Features
- No new features, but we have fixed a couple of watch face editor bugs.
API Changes
- Deprecated
UserStyleSchema.userStyleSettingsasrootUserStyleSettingsbecome non-experimental (Ie96e3) - Move
rootUserStyleSettingsout of experimental (I8d6b3) - We've marked
WatchFaceColorsas experimental because it is not supported by all systems (I6d75d) - Expose
DisconnectReasonsin the public API to make it work withIntDef. (I791f8)
Bug Fixes
- Close any open on watch editor if
SysUIdies. IfSysUIdies and the on watch face editor doesn't close, the watch face could be left in an inconsistent state because the system relies onSysUIto persist any user style changes.(ba762a - Fix a memory leak in
ComplicationDataSourceInfoRetriever, where a kotlin coroutine continuation was acting as a gc root and retaining the editor activity.(33ee06)
Version 1.2.0-alpha02
September 21, 2022
androidx.wear.watchface:watchface-*:1.2.0-alpha02 is released. Version 1.2.0-alpha02 contains these commits.
New Features
Some watch faces have configuration outside of the
UserStylethat affects it visually, (e.g. selecting a background photo). We’ve addedRenderer.sendPreviewImageNeedsUpdateRequestwhich allows the watch face to request an updated preview image. Note this requires a corresponding system up date to work.We’ve also added an API for watch faces to expose their colors to the system which may choose its color palette based on this. Note that this has been made experimental in a follow on patch.
Just about every type of
ComplicationDatanow supportsSmallImages.
API Changes
- Wallpaper manager can sometimes detach from an engine and make another. We've added a
DisconnectReasonint def and extendedClientDisconnectListenerwith a new method which includes aDisconnectReason, allowing the listener to observe engine detaches. (I45cce) - Added two optional parameters
nameResourceIdandscreenReaderResourceIdtoComplicationSlotOverlayconstructor (I157e8) - We've added a guava wrapper for the new overload of
getOrCreateInteractiveWatchFaceClientwith aPreviewImageUpdateRequestedListener. (Ic31f0) - We've added
Renderer.sendPreviewImageNeedsUpdateRequestwhich is useful for watch faces that have state outside of theUserStyleSchemawhich affects the way they look (e.g. a watch face with a selectable background image). On the client side we've addedPreviewImageUpdateRequestedListeneras an optional parameter togetOrCreateInteractiveWatchFaceClientto observe these requests. (Iff44a) - We've simplified the API for exposing
WatchFaceColors, now there's a simple property calledwatchFaceColorson the Renderer which the watch face can set, this should be updated as necessary in response to any style changes. Instead of usingWallpaperManagerto observe color changes, we've addedOnWatchFaceColorsListenertoInteractiveWatchFaceClient. (I490bc) - We've added a
WatchFaceColorsclass which holds the three most prominent watch face colors and added open methodswatchfaceColors¬ifyWatchFaceColorsChangedto the Renderer, these allow the system to obtain the colors of the watch face viaWallpaperManager.getWallpaperColors. (I3d611) ShortTextComplicationData,RangedValueComplicationData,NoPermissionComplicationData(and experimentalDiscreteRangedValueComplicationData,GoalProgressComplicationDataandWeightedElementsComplicationData) now all supportSmallImages. If a watch face chooses to render a complication with multiple colors, it now has the option to use a multi-coloredSmallImagewhere previously it would have had to use a monochromatic image. (I257df)- Refactor
PreviewImageUpdateRequestedListenerto be aConsumer<>instead (Ia875d) - Replace custom Single Abstract Method (SAM) type
OnWatchfaceColorsListenerwith generic Java SAM type (Consumer) (I0c489) - We've deprecated the old
getOrCreateInteractiveWatchFaceClientandlistenableGetOrCreateInteractiveWatchFaceClientmethods that don't specify aPreviewImageUpdateRequestedListener. (Iec502)
Bug Fixes
DisconnectReason.BINDER_DIEDhas been renamed toDisconnectReason.ENGINE_DIED. (I4eb0e)
Version 1.2.0-alpha01
August 10, 2022
androidx.wear.watchface:watchface-*:1.2.0-alpha01 is released. Version 1.2.0-alpha01 contains these commits.
New Features
- We’ve added experimental support for various new complication formats. This is an area of active development; these new formats are subject to change without notice and currently there’s no renderer support from
CanvasComplicationDrawable. - We’ve also added optional margins to complication slots which make small complications easier to tap on.
API Changes
- The experimental
BoundingArcclass is now immutable. (If624a) - Small complications can be tricky to tap on. To help mitigate this, we've introduced support for margins which increase the tappable area without affecting rendering. Unless specified (either in code or via XML)
ComplciationSlotshave zero sized margins. (I14089) - Changed
getComplicationSlotInflationFactory(CurrentUserStyleRepository)signature to return a non-null factory instance. It was an error to return null before, so this is just making the API contract clearer. (I0fcc0) - We've added
currentUserStyleRepositoryargument to theWatchFaceService.getComplicationSlotInflationFactorymethod to be consistent withcreateComplicationSlotsManager. (I2ddd2) UserStyleFlavorshave become non-experimental feature. (I69cdc)- We have removed the experimental
ValueTypefromRangedValueComplicationDataand instead introduced experimentalDiscreteRangedValueComplicationDatawhich is likeRangedValueComplicationDataexcept for integer range & value. We've also introduced experimentalGoalProgressComplicationDatawhich is similar toRangedValueComplicationDataexcept it's for progress towards a goal where min implicitly is zero, and the value is allowed to be larger thantargetValue. Note for allRangedValuevariants at least one of monochromeImage, text or title must be specified. (I9590c) - We removed
boundsWithMarginsfromComplicationSlotStatebecause system software doesn't have a use case for it. (I42e26) - We've added experimental support for
WeightedElementsComplicationDatawhich consists of an array of Elements (pairs of weight and color) along with optional text/title/image. These might be displayed as a pie chart where the colors need to be meaningful given the context, since there typically isn't room in a complication to render labels. (I87eea) - The experimental
ColorRampsoptionally used byRangedValueComplicationDataandGoalProgressComplicationDatanow allow you to specify a sequence of up to seven colors and a flag stating whether the colors should be smoothly tweened or whether equal sized solid steps of color should be rendered. (I9f5bf) RangedValueComplicationData.drawSegmentedhas been changed tovalueTypewhich is an int with a correspondingValueType IntDefwhich provides semantic meaning to the ranged value and may be used by the complication renderer to influence styling. (I0616b)- We've added experimental support for optional
ColorRangestoRangedValueComplicationData. Normally complications would be rendered in colors of the watch face's choosing, but sometimes theComplicationDataSourceis best placed to set the colors e.g. when they have a particular semantic meaning. E.g. red to blue for temperature. (I5153a) - We've added an experimental
drawSegmentedhint toRangedValueComplicationData. This signals renderers to draw the ranged value indicator with segments, where 1 segment = 1 unit. (I7d7c1)
Bug Fixes
- We've added the ability to define
ComplicationSlotBoundsrelative to a predefined screen coordinate system. (I0985d)
Version 1.1
Version 1.1.1
August 10, 2022
androidx.wear.watchface:watchface-*:1.1.1 is released. Version 1.1.1 contains these commits.
- This is a bug fix release and users of version 1.1.0 are strongly encouraged to upgrade.
Bug Fixes
Watch face initialization is asynchronous and if a complication is received before the watch face is ready it gets put on the
pendingInitialComplicationslist and is applied later. UnfortunatelypendingInitialComplicationswas applied too soon which meant there was a window of time during watch face initialization where complications would still get put onpendingInitialComplicationsand be ignored. This has now been fixed. In addition This patch fixes a bug whereComplicationRendererwas wrongly trying to load placeholders asynchronously, which failed leading to the compilation graphic never updating. Finally this patch fixes a hopefully theoretical bug where multiplependingInitialComplicationsneed to be merged. (0d03ba3)Fix potential deadlock in
InteractiveInstanceManagerwheregetExistingInstanceOrSetPendingWallpaperInteractiveWatchFaceInstancewas holding the lock longer than necessary. Usually we'd expectengine.setUserStyleto be quick but if for some reason it's not then we could end up with a deadlock/ANR. This patch moves unnecessary work out of the lock, removing the potential for a deadlock.(5a2adca)Fix several issues that retained
WatchFaceService. The WakeLock can sometimes retain theWatchFaceService, adding arelease()call fixes this. Also theStateFlowscan retainWatchFaceService, canceling the underlyingCoroutineScopesfixes that.(fd48138)Add timeouts to
awaitDeferredWatchFace* and fixwatchfaceOverlayStyleNullPointerException. In normal circumstances this shouldn't timeout including after fresh install andDirectBootscenarios where the CPU load is high. We've also fixed a NPE ifgetWatchfaceOverlayStyleis called afterclose().(a4c3a5a)
Version 1.1.0
June 15, 2022
androidx.wear.watchface:watchface-*:1.1.0 is released. Version 1.1.0 contains these commits.
Important changes since 1.0.0
Improved Editing:
- We added support for hierarchical schemas, which allows a hierarchy of styles to be scribed by editor UIs. You can now specify separate icons for use by on watch face and companion editors.
- There is opt-in support for multiple instances of a watch face, each instance has a unique ID available across all API surfaces.
- You can now specify human readable names for
ComplicationSlotsfor use in editors. - Experimental support for styling “flavors”, a curated selection of styles which will be visible from the companion editor.
- When editing two instances of the watchface are loaded, it’s now possible for watchface instances to share resources, saving memory
- When picking a complication in the on watch face editor, the current provider is now preselected.
Improved Complications:
- You can now specify the
ComplicationTypefor the primary and secondary data sources, giving developers more flexibility for the out of box experience. - We added
ComplicationDataTimelinewhich provides a sequence of time-gated data to be delivered to the watch face which can be cached and updated automatically. For example, today's weather forecast at various times or multiple upcoming calendar events. - The
ComponentNameof the complication provider is part of theComplicationData. - Complications are now cached which provides a better experience when switching between watch faces.
Other changes:
- The
UserStyleSchemaandComplicationSlotscan now be defined in XML. This simplifies watch face construction and allows for faster metadata queries from the system. - Watch faces can now influence the colors used for rendering the system overlay.
Version 1.1.0-rc01
May 18, 2022
androidx.wear.watchface:watchface-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
New Features
- We’ve made some usability tweaks to watchface XML support, making it easier to specify
ComplicationSlotBoundsand supporting references. Experimentation with edge complicationBoundingArccontinues, plumbing it through todrawHighlightalthough it’s not recommended for use at that time.
API Changes
- We've added an experimental overload of
drawHighlightwhich accepts aBoundingArcparameter. (I705f8) - Watch face XML now supports resource references. It lets you use the same constants both in XML and your code. (I3ef61)
- We've added the ability to define
ComplicationSlotBoundsincenter_x,center_y,size_x,size_yform. Now it is also possible to use different units (i.e. dp) using resource references. (Iace98)
Bug Fixes
- Fix
runBlockingWithTracingwhich was running tasks on the wrong context.(4f595fe) - Make
BaseEditorSession.closesynchronous. The problem withBaseEditorSession.closebeing asynchronous is that we release theComplicationDataSourceInfoRetrievertoo late leading to warning spam in logcat. This was probably harmless but logcat spam is distracting and should be avoided.(35a5308)
Version 1.1.0-beta02
May 11, 2022
androidx.wear.watchface:watchface-*:1.1.0-beta02 is released. Version 1.1.0-beta02 contains these commits.
New Features
- We’ve added experimental support for new
ComplicationDatatypes, these are not yet ready for use but watch this space.
API Changes
- We've added
BoundingArc, an experimental class that describes the geometry of an edge complication slot. This has been added toComplicationSlotand plumbed through toComplicationSlotStateandWatchFaceMetadataClient. (I61a40) - We've added the ability to inherit settings in
UserStyleSettingXML. It lets you reduce verbosity and share a setting between watchfaces. (Ief841) - We have added two new experimental types of
ComplicationData:ListComplicationData&ProtoLayoutComplicationData. Currently there's no rendering support for either of these types and WearOS doesn't currently recognize these types if added to aComplicationDataSource'smanifest. (I1811c)
Bug Fixes
- Fix serialization of
TimeLineEntrytype. We were not serializing theTimeLineEntrytype which meant cachedTimeLineEntriesof type NoData would be incorrectly interpreted as having the parent complication's type leading to NPEs when non-existent required fields were accessed. (55ffdf5) - Fix a bug where
setComplicationDatadropped timeline fields(fb392f5) - Fixes a bug where very occasionally
runBlockingWithTracingwould lead to an NPE(12ca62e) - Fixes a bug where we sometimes get
ClassNotFoundException: android.support.wearable.complications.ComplicationTextwhen receiving a complication.(217942d9) - Fixes a bug in
GlesRenderer.backgroundThreadInitInternalwhere it was only callingonBackgroundThreadGlContextCreatedifEGL14.eglCreateContextwas called. Fixes another bug where there was a visual glitch in the screenshot caused byverticalFlip.(c674ad2) - Fix
WatchFaceServiceXML version check, it was loading from the wrong package.(dfa06f3) - Placeholder wire format now uses an inner bundle. We don't want placeholders to break existing watchfaces which might use the hidden inner a.s.w.c.ComplicationData. Previously the wire format of a
NoDataComplicationdata stored the placeholder in the usual fields (problematic because old watch faces would render the placeholder string which isn't intended), instead we now use an inner bundle to fully isolate this.(d5e7bd2)
Version 1.1.0-beta01
April 20, 2022
androidx.wear.watchface:watchface-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
API Changes
- Now
WatchFaceMetadataClientmethods (getUserStyleSchema,getComplicationSlotMetadataMap,getUserStyleFlavors) andHeadlessWatchFaceClient.getUserStyleFlavorsthrow unchecked RuntimeException instead ofWatchFaceException. (I0718a) WatchFaceMetadataClient.WatchFaceExceptionhas been moved out of the class to allow it to be reused. (I4e869)
Bug Fixes
WatchFaceMetadataClientwill no longer crash when sent partialComplicationSlotBounds.(Iaafd)
Version 1.1.0-alpha05
April 6, 2022
androidx.wear.watchface:watchface-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.
New Features
- You can now tell which data source sent a
ComplicationDataby inspectingComplicationData.dataSource, some watch faces may use this to customize complication display. (I44a73)
API Changes
Renderer.CanvasRendererandRenderer.GlesRendererhave been deprecated in favor ofRenderer.CanvasRenderer2andRenderer.GlesRenderer2which supportSharedAssetswhich are passed to the render methods. For java interop we've introducedListenableCanvasRenderer2andListenableGlesRenderer2. (I31ffa)- Added
@WatchFaceFlavorsExperimentalability to define flavors - preconfigured list of styled watchfaces (I04dd0) Renderer.sharedAssetsis now a StateFlow and we've removed the unusedRenderer.SharedAssetsFactory(I12ac5)UserStyleSchema.userStyleSettingsis not deprecated anymore (Iba7e3)- We've added
HeadlessWatchFaceClient.getUserStyleSchemaDigestHashwhich allows aHeadlessWatchFaceClientto avoid the relatively low overhead of passing the schema over AIDL before computing the digest hash. (I33597) - We've added
isUserStyleSchemaStatictoWatchFaceMetadataClientwhich is true if and only if theUserStyleSchemacan be relied on not to change unless the watch face APK is updated. (I45a3f) - We have added
getDigestHashtoUserStyleSchemawhich computes a digest hash of the schema. This can be used to efficiently determine if theUserStyleSchemahas changed. (I2063d) METADATA_KEY_DATA_SOURCE_DEFAULT_CONFIGURATION_SUPPORTEDrenamed toMETADATA_KEY_DATA_SOURCE_DEFAULT_CONFIG_SUPPORTED(I9ba5d)UserStyleSetting.OnWatchEditorDatahas been renamed toUserStyleSetting.WatchFaceEditorData, it contains data that's used purely by the on watch face editor. (If3afb)
Version 1.1.0-alpha04
March 9, 2022
androidx.wear.watchface:watchface-*:1.1.0-alpha04 is released. Version 1.1.0-alpha04 contains these commits.
API Changes
- Up to date
ComplicationDatamay not always be available (e.g. expired cached ComplicationData) so we've extendedNoDataComplicationwith an optional placeholder ComplicationData and addedComplicationText.PLACEHOLDER,MonochromaticImage.PLACEHOLDER,SmallImage.PLACEHOLDER,PhotoImage.PLACEHOLDERwhich are only allowed to be used inside the context of aNoDataComplicationDataplaceholder. If selected these placeholders are suggested to be rendered with gray boxes/arcs. (I6285d) - We've added
ComplicationData.getNextChangeInstantwhich tells you the next Instant after the reference Instant at which any field of the complication may change. This is used internally to schedule frames for complication updates. E.g. if a watch face normally updates once per minute, setting the stop watch complication will cause it to update once per second. (I7ceb2) EditorSession.watchFaceIdcan now be used on all API levels. In addition its value will now always be consistent withWatchState.watchFaceInstanceId. (I323b9)- The
getPendingIntentForTouchEventAPI is no longer necessary since the underlying issue has been fixed in the framework, so all the related APIs have been removed. Watchfaces do not need to do anything special forPendingIntentsto fire, even if the home button has recently been pressed. (I1f2e8) - We've added
RendererParameters.isForScreenShotwhich will be true if the render is for a screen shot. Some watch faces with animations need to know this in order to make adjustments to ensure the best results. (I96d99) - We've added
WatchFaceExceptionReasontoWatchFaceExceptionto give some context to what went wrong. (I01d15) ComplicationDataSourceService.onImmediateComplicationRequesthas been removed, insteadComplicationRequest.immediateResponseRequiredhas been added to signal that the provider needs to respond quickly (ideally responding in < 100ms). Note this functionality is guarded behind the privilegedcom.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATEpermission. (Ie6b23)- Updated nullability in core and appcompat to match Tiramisu DP2 (I0cbb7)
Bug Fixes
- Now watchface app crashes with an exception if the schema validation fails (Ia400f)
Version 1.1.0-alpha03
February 9, 2022
androidx.wear.watchface:watchface-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.
API Changes
- We've added experimental support for hierarchical style schemas. We've added a new property to
androidx.wear.watchface.style.UserStyleSetting.Option, childSettings which is initially only used byListOption. This allows a hierarchy of styles to be described for use by Editor UIs, the underlying UserStyle is unchanged and is still aMap<String, ByteArray>. (Iaf6f4) - We've added
WatchFace.OverlayStylewhich allows the watch face to configure the rendering of the system status overlay. (I8520d) - We've introduced
clearWithBackgroundTintBeforeRenderingHighlightLayera new optional constructor parameter forCanvasRenderer(default is false), if set to true then the canvas will be cleared with the background tint color. (Ie01e5) - Added
androidx.watchface.complications.datasource.DEFAULT_CONFIGURATION_SUPPORTEDmetadata key which allows complication data sources to indicate they can provide a default value without any configuration (Icc0d4) - It's common when editing a watch face for there to be both an interactive and a headless instance. To help save memory we've introduced
Renderer.SharedAssetswhich allows a watch face renderer to share immutable data (e.g. textures and shaders) between instances.GlesRenderer.setEglConfigandGlesRenderer.setEglDisplayare deprecated, it was never intended for these to be settable, and doing so would have led to undefined behavior. (I0d9e7) - We've added
setNameResourceId&setScreenReaderNameResourceId(which reference string resources) toComplicationSlot.Builderand corresponding getters inandroidx.wear.watchface.client.ComplicationSlotState. This allows the system to fetch the names of ComplicationSlots for use in editors and screen readers. (If6c6a) WatchfaceMetadataClient.getUserStyleSchemaandgetComplicationSlotMetadataMapnow throwWatchFaceExceptioninstead ofRemoteException. (I86f11)onSynchronousComplicationRequestand related functions inComplicationDataSourceServicehave been renamed toonImmediateComplicationRequestetc... (I87ba0)- Watch face editors have much less screen real estate than companion editors, therefore it makes sense to support different icons for on watch face editors. This patch adds
OnWatchEditorData(currently containing just an icon) to all UserStyleSettings and where appropriate their Option classes. (If1886) - We've added
@JvmOverloadsto ListenableGlesRenderer's constructor for better java interop. (I2974a)
Bug Fixes
ListenableGlesRenderer's constructor is now correctly marked as@Throws(GlesException::class), and it is now possible to extend this class in java. (Iac6d0)- Fixes bug with
PhotoImageComplicationDatatapAction not being correctly handled (I1cc30)
Version 1.1.0-alpha02
January 12, 2022
androidx.wear.watchface:watchface-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.
New Features
- To aid debugging and testing,
ComplicationDataand related subclasses now have overridden hashcode, equals and toString methods making them easier to work with.
API Changes
WatchfaceMetadataClientmethods once again throwRemoteExceptionswhere appropriate, making it easier for client code to catch errors from the watch face. (I78785)ComplicationDataand sub classes now have hashcode, equals and toString. (I24bc6)
Version 1.1.0-alpha01
December 15, 2021
androidx.wear.watchface:watchface-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
New Features
The
UserStyleSchemaandComplicationSlotscan now be defined in XML. This simplifies watch face construction. In addition,WatchFaceMetadataClientqueries are faster because it doesn't need to bind to the service to get the metadata. TheWatchFaceMetadataClientandListenableWatchFaceMetadataClientare no longer experimental and will become part of the stable api. The system will be able to optionally support multiple instances of a watch face, each with distinct user defined styling options. These will be visible in the watch face picker. To opt into this a watch face must include the following meta data tag in its manifest.<meta-data android:name="androidx.wear.watchface.MULTIPLE_INSTANCES_ALLOWED" android:value="true" />Some watch faces have state that’s not captured in the
UserStyle, to support this and multiple instances, the watch face's instance ID is now available viaWatchState.watchFaceInstanceId.ComplicationDatais now being cached to allow complications to be displayed immediately upon loading. SometimesComplicationDatais cached in memory by the system and sometimes it is serialized by the watch face libraries. When serialized any associated tapAction will be lost, if this happensComplicationData.tapActionLostDueToSerializationwill returntrueand the watch face should render the complication differently (e.g. grayed out or semi-transparent) to signal that it can’t be tapped. The system will send updatedComplicationDatawith atapActionas soon as possible.Some
ComplicationDatashouldn’t be cached for a long time, to support this we’ve added a more general featureComplicationDataTimeline. This can be used to provide a sequence of time-gatedComplicationDatato be delivered to the watch face which can be cached and updated automatically. For example, today's weather forecast at various times or multiple upcoming calendar events.ComplicationRequestListenerhas been extended with a new methodonComplicationDataTimelinewhich you can use to return this data.DefaultComplicationDataSourcePolicyhas been extended so you can specify theComplicationTypefor the primary and secondary data sources.We've added support for synchronous complication providers where the complication is updated at a higher frequency than normal, up to once per second when the watch face is visible and non-ambient. Note: synchronous complication providers may have limited usage due to memory pressure concerns.
The
PendingIntentTapListenerchanges are likely to be reverted because we solved the underlying problem (it’s not possible for the watch face to launch activities for 5 seconds after pressing the home button) in the framework instead.
API Changes
ComplicationData.isCachedhas been changed totapActionLostDueToSerializationwhich is more useful when determining if the complication slot should be rendered differently to signal that it can't be tapped. (I6de2f)- Added
ComplicationDataTimelinetowear-complication-data-source. This can be used to provide a sequence of time-gatedComplicationDatato be delivered to the watch face which can be cached and updated automatically. For example, today's weather forecast at various times or multiple upcoming calendar events.ComplicationRequestListenerhas been extended with a new methodonComplicationDataTimelinewhich you can use to return this data. There's a new kotlin wrapperSuspendingTimelineComplicationDataSourceServicefor suspending data source services. (Idecdc) - Added
PendingIntentTapListenerandWatchFaceControlClient.getPendingIntentForTouchEvent. This can help watch faces that need to launch intents in response to taps to work around a problem where the framework blocks launching new activities for 5 seconds after pressing the home button. (I98074) - Introduced a per-watchface
ComplicationDatacache. The purpose of this is to allow the watch face to display last known complication data values upon loading until the system has had a chance to update them. There is a new API methodWatchFaceControlClient.hasComplicationCacheintended for OEMs. This may influence the system's strategy for sending complications to a watch face. In addition,ComplicationDatahas anisCachedproperty and it is recommended that cached complications are rendered differently because thetapActioncan not be cached and will benullin a cached complication. (I404b0) - The watch face's instance ID is now available via
WatchState.watchFaceInstanceId. Most watch faces won't need to use this, but if there's a per-watch face state that's not stored in the Schema then this is the key to use to identify the watch face instance. To help support this you can now provide an ID when callingWatchFaceControlClient.createHeadlessWatchFaceClient. (I1ff98) - Extended
DefaultComplicationDataSourcePolicywith the ability to set the defaultComplicationTypesfor the primary, secondary provider and for the fallback system provider.ComplicationSlot.defaultDataSourceTypeis now deprecated. (If0ce3) ComplicationSlot.configExtrasis now mutable and can be updated before callingEditorSession.openComplicationDataSourceChooser(). (I6f852)- Added
WatchFace.setComplicationDeniedDialogIntentandsetComplicationRationaleDialogIntent. These intents are launched to to show a rationale dialog before requesting complication permissions, and another dialog explaining that complication permission is needed when trying to edit a complication when permissions have been denied (the provider chooser will fail to open so the dialog is needed). (I3a29c) - The
UserStyleSchemaandComplicationSlotscan now be defined in XML. This simplifies watch face construction and makesWatchFaceMetadataClientqueries faster as they do not need to bind to the service to get the metadata. (I85bfa) - Added
InteractiveWatchFaceClient.supportsPendingIntentForTouchEventso a client can determine if a watch face supportsgetPendingIntentForTouchEvent. (I0b917) WatchFaceMetadataClientandListenableWatchFaceMetadataClientare no longer experimental. They can be used to efficiently obtain watch face metadata, where possible without opening a binder to the watch face. (Ibb827)- Added support for synchronous complication providers where the complication is updated at a higher frequency than normal, up to once per second when the watch face is visible and non-ambient. To use this the provider must include a new
androidx.wear.watchface.complications.data.source.SYNCHRONOUS_UPDATE_PERIOD_SECONDSmetadata tag in its manifest and overrideonSynchronousComplicationRequest. Depending on the nature of the data source, it may also need to overrideonStartSynchronousComplicationRequestsandonStopInteractiveComplicationRequeststo get notifications of when the complication enters and exits interactive mode. (I8fe9d)
Version 1.0
Version 1.0.1
February 9, 2022
androidx.wear.watchface:watchface-*:1.0.1 is released. Version 1.0.1 contains these commits.
Bug Fixes
- Fixes bug with
PhotoImageComplicationDatatapAction not being correctly handled (I1cc30)
Version 1.0.0
December 1, 2021
androidx.wear.watchface:watchface-*:1.0.0 is released. Version 1.0.0 contains these commits.
Major Features of 1.0.0
The androidx.wear.watchface package is the new recommended library for developing WearOS watch faces. It has a number of new features over the old Wearable Support Library.
- User styling (e.g. to change the color palette, the style of the watch hands, the look of the hour marks etc) is directly supported by the library (see
androidx.wear.watchface.style). It’s now much easier to develop an on watch face editor using androidx.wear.watchface.editor and your watch face can be edited from the system companion app without you needing to write any extra code. - Best practices baked in. The library automatically generated screen reader content labels for complications (you can also add your own ones), and the framerate automatically drops when the battery is low and not charging to improve battery life.
- Less code is needed to develop a watch face, especially for complications where a lot of the boilerplate has moved into the library.
Bug Fixes
- Fix
EditorSession.userStyle.compareAndSet(I6f676) - Fix very short watch face delays (Iffb97)
- Dispatch
InteractiveWatchFaceImpl.onDestroyon the UI thread (I83340) - Fix several problems with broadcast receivers (I7d25f)
Version 1.0.0-rc01
November 3, 2021
androidx.wear.watchface:watchface-*:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.
Bug Fixes
Fix dump() (called by adb shell dumpsys) which got broken by flow migrations. (087cf9e)
Ensure proper ordering of writeDirectBootPrefs. We want writeDirectBootPrefs to always run after initStyleAndComplications or we risk delaying UI thread init.(37650ac)
Ensure Renderer.onDestroy is called. In the scenario where the renderer has been created but WF init has not completed and Engine.onDestroy is called, we need to call Renderer.onDestroy. (f9952dc)
Optimization/fix to isBatteryLowAndNotCharging. This patch moves the initial setup of isBatteryLowAndNotCharging earlier which means it can be done in parallel with createWatchFace. In addition we now listen to ACTION_POWER_DISCONNECTED. (ddffd80
InteractiveWatchFaceClientImpl.isConnectionAlive to be false after close (ab9774e)
Version 1.0.0-beta01
October 27, 2021
androidx.wear.watchface:watchface-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
Version 1.0.0-alpha24
October 13, 2021
androidx.wear.watchface:watchface-*:1.0.0-alpha24 is released. Version 1.0.0-alpha24 contains these commits.
API Changes
- Classes in package
androidx.wear.watchface.complicationshave been moved into a newwear:watchface:watchface-complicationsproject. Note this means you can't include this library as well as any previous alpha version ofwear:watchface:watchface-complications-databecause you'll get errors about duplicate classes. (I97195) - Renderer.dump has been renamed to Renderer.onDump and has been annotated with @UiThread. (I44845)
InteractiveWatchFaceClient.addWatchFaceReadyListenerhas been renamed toaddOnWatchFaceReadyListenerandremoveWatchFaceReadyListenerhas been renamed toremoveOnWatchFaceReadyListener. (I48fea)- EditorSession
getComplicationsPreviewDataandgetComplicationsDataSourceInfoare no longer suspend functions, instead they areStateFlow<>properties whose value is initially null. In ListenableEditorSessiongetListenableComplicationPreviewDataandgetListenableComplicationsProviderInfohave been removed in favor of the newStateFlow<>objects from the base class. If you need to listen to changes in java code, consider usingandroidx.lifecycle.FlowLiveDataConversions.asLiveDatato convert toLiveData<>. (Ic5483)
Version 1.0.0-alpha23
September 29, 2021
androidx.wear.watchface:watchface-*:1.0.0-alpha23 is released. Version 1.0.0-alpha23 contains these commits.
New Features
The watchface library is now a single library group, and as a result the libraries have moved and you will need to update your gradle imports as follows:
| Old | New |
|---|---|
androidx.wear:wear-complications-data |
androidx.wear.watchface:watchface-complications-data |
androidx.wear:wear-complications-data-source |
androidx.wear.watchface:watchface-complications-data-source |
androidx.wear:wear-watchface |
androidx.wear.watchface:watchface |
androidx.wear:wear-watchface-complications-rendering |
androidx.wear.watchface:watchface-complications-rendering |
androidx.wear:wear-watchface-client |
androidx.wear.watchface:watchface-client |
androidx.wear:wear-watchface-client-guava |
androidx.wear.watchface:watchface-client-guava |
androidx.wear:wear-watchface-data |
androidx.wear.watchface:watchface-data |
androidx.wear:wear-watchface-editor |
androidx.wear.watchface:watchface-editor |
androidx.wear:wear-watchface-editor-guava |
androidx.wear.watchface:watchface-editor-guava |
androidx.wear:wear-watchface-guava |
androidx.wear.watchface:watchface-guava |
androidx.wear:wear-watchface-style |
androidx.wear.watchface:watchface-style |
API Changes
- Migrate the separate
androidx.wearWatchface and complications libraries intoandroidx.wear.watchfacelibrary group. (b25f3c0) - Added EditorRequest.canWatchFaceSupportHeadlessEditing to let a client know if a watchface editor supports headless editing. Note there will be some false negatives with this because support was added in asop/1756809 however it will return the correct value for all future watchfaces. (ca55590)
- Renderer now has a dump() method which can be overridden to add custom data to the information generated by ABD shell dumpsys activity service WatchFaceService. (95235f9)
- InteractiveWatchFaceClient.addWatchFaceReadyListener now specifies the executor first. (563ac2f)
- StateFlowCompatHelper has been removed. asLiveData (androidx.lifecycle.asLiveData) should be used instead. (bd35d3)
- CurrentUserStyleRepository.userStyle is no longer mutable. (I44889)
- WatchFaceReadyListener has been renamed to OnWatchFaceReadyListener. (Ic12a9)
Bug Fixes
- InteractiveInstanceManager.deleteInstance to call onDestroy This is needed to ensure InteractiveWatchFaceImpl gets garbage collected.(fce4af8, b/199485839)