Wear
androidx.wear.activity
androidx.wear.ambient
androidx.wear.complications
androidx.wear.input
androidx.wear.utils
androidx.wear.widget
androidx.wear.watchface
androidx.wear.widget.drawer
(See the refdocs for all wear packages)
This table lists all the artifacts in the androidx.wear
group.
Artifact | Current Stable Release | Next Release Candidate | Beta Release | Alpha Release |
---|---|---|---|---|
wear | 1.1.0 | - | - | 1.2.0-alpha07 |
wear-input | 1.0.0 | - | - | 1.1.0-alpha01 |
wear-complications-data | - | - | - | 1.0.0-alpha11 |
wear-complications-provider | - | - | - | 1.0.0-alpha11 |
wear-watchface | - | - | - | 1.0.0-alpha11 |
wear-watchface-client | - | - | - | 1.0.0-alpha11 |
wear-watchface-complications-rendering | - | - | - | 1.0.0-alpha11 |
wear-watchface-data | - | - | - | 1.0.0-alpha11 |
wear-watchface-editor | - | - | - | 1.0.0-alpha11 |
wear-watchface-style | - | - | - | 1.0.0-alpha11 |
wear-ongoing | - | - | - | 1.0.0-alpha03 |
wear-phone-interactions | - | - | - | 1.0.0-alpha04 |
wear-remote-interactions | - | - | - | 1.0.0-alpha03 |
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:
dependencies { implementation "androidx.wear:wear:1.1.0" // Add support for wearable specific inputs implementation "androidx.wear:wear-input:1.0.0" implementation "androidx.wear:wear-input-testing:1.0.0" // Use to implement wear watchface complications implementation "androidx.wear:wear-complications-provider:1.0.0-alpha1" // Use to implement wear watchfaces implementation "androidx.wear:wear-watchface:1.0.0-alpha11" // Use to implement a watchface style and complication editor implementation "androidx.wear:wear-watchface-editor:1.0.0-alpha11" // Use to implement wear ongoing activities implementation "androidx.wear:wear-ongoing:1.0.0-alpha03" // Use to implement support for interactions from the Wearables to Phones implementation "androidx.wear:wear-phone-interactions:1.0.0-alpha04" // Use to implement support for interactions between the Wearables and Phones implementation "androidx.wear:wear-remote-interactions:1.0.0-alpha03" }
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.
Wear Ongoing & Interactions Version 1.0.0
Wear-Phone-Interactions Version 1.0.0-alpha04
April 7, 2021
androidx.wear:wear-phone-interactions:1.0.0-alpha04
is released. Version 1.0.0-alpha04 contains these commits.
API Changes
- Updated
ErrorCode
constants to make the new library backwards compatible with the implementation in Wearable Support Library.
Bug Fixes
- Fixed exception caused by new OAuth API when starting an OAuth session.
Wear-Remote-Interactions Version 1.0.0-alpha03
April 7, 2021
androidx.wear:wear-remote-interactions:1.0.0-alpha03
is released. Version 1.0.0-alpha03 contains these commits.
API Changes
- Changed
PlayStoreAvailability
to be a class that contains companion object with static methods. Usage stays the same.
Bug Fixes
- Fixed summary doc for
WatchFaceConfigIntentHelper
to correctly show sample code with actual HTML characters.
Wear-Ongoing Wear-Phone-Interactions Version 1.0.0-alpha03
March 10, 2021
androidx.wear:wear-ongoing:1.0.0-alpha03
and androidx.wear:wear-phone-interactions:1.0.0-alpha03
are released. Version 1.0.0-alpha03 contains these commits.
New Features
- Migrate OAuthClient from Wearable Support Library to AndroidX. This migrated class is renamed to RemoteAuthClient and it gives support for remote authentication on Wearables together with support for adding OAuth PKCE extension. Additional handlers and helper classes for communication are provided.
- Ongoing activities can now be associated with a Notification that has a tag, using the new OngoingActivity.Builder constructor.
API Changes
- Added support for notification tags on the Ongoing Activities Library (I653b4)
- Migrate OAuthClient from Wear Support Library to AndroidX, and add support for OAuth PKCE extension (I3eaaa)
Wear-Remote-Interactions Version 1.0.0-alpha02
March 10, 2021
androidx.wear:wear-remote-interactions:1.0.0-alpha02
is released. Version 1.0.0-alpha02 contains these commits.
New Features
- Migrating PlayStoreAvailability class from Wearable Support Library to AndroidX which provides an API for checking whether the Play Store is available on the Phone.
Bug Fixes
- Migrating PlayStoreAvailability class from Wearable Support Library to AndroidX. (I69bfe)
Version 1.0.0-alpha02
February 10, 2021
androidx.wear:wear-ongoing:1.0.0-alpha02
and androidx.wear:wear-phone-interactions:1.0.0-alpha02
are released. Version 1.0.0-alpha02 contains these commits.
API Changes
- Added support for more complex status. They are composed of a template (or several) and a series of Parts that will be used to fill the template's placeholders. OngoingActivityStatus now has a static method to create simple statuses with only one part (a Text or a Timer), and a Builder to create more complex statuses. (I1fe81)
- Move BridgingManager and BridgingConfig classes from Wear Support Library to AndroidX which provides APIs to enable/disable notifications at runtime and optionally set tags for notifications that are exempt from the bridging mode. (I3a17e)
Version 1.0.0-alpha01
January 27, 2021
androidx.wear:wear-ongoing:1.0.0-alpha01
, androidx.wear:wear-phone-interactions:1.0.0-alpha01
, and androidx.wear:wear-remote-interactions:1.0.0-alpha01
are released. Version 1.0.0-alpha01 contains these commits.
API Changes
Migrate the Ongoing Activities library to a new sub-library: wear-ongoing. Classes now live in the androidx.wear.ongoing package (previously was androidx.wear.ongoingactivities) (I7c029)
Create a new support library to contain classes that support interactions from the Wearables to Phones. It is initially populated with classes migrated from Wearable Support Library. (Id5180)
Migrate PhoneDeviceType class from Wearable Support Library to AndroidX. The migrated class is renamed as PhoneTypeHelper which provides helper methods for determining the type of phone the current watch is paired to, for use on Wearable devices only. (Ibd947)
Create a new support library to contain classes that support interactions between the Wearables and Phones. It is initially populated with classes migrated from Wearable Support Library. (I9deb4)
Migrate WatchFaceCompanion class from Wearable Support Library to AndroidX. The migrated class is renamed as WatchFaceConfigIntentHelper which provides helper functions to specify the ID and component name in the watch face configuration activities in companion on the phone, it can also be used locally to configure the watch face on the wearable device. (Ia455f)
Wear Complications and Watchface 1.0.0
Version 1.0.0-alpha11
April 7, 2021
androidx.wear:wear-*:1.0.0-alpha11
is released. Version 1.0.0-alpha11 contains these commits.
New Features
- More polish has been applied to the watch face APIs. Most of the changes are simple renamings but
InteractiveWatchFaceWcsClient
andInteractiveWatchFaceSysUiClient
have been merged intoInteractiveWatchFaceClient
.
API Changes
- ContentDescriptionLabel.text is now a ComplicationText rather than the old wearable support library TimeDependentText. (I80c03)
SystemProviders.GOOGLE_PAY
is not guaranteed to be present on all Android R devices so it has been removed from the list. It's still possible to use this provider viaDefaultComplicationProviderPolicy
(If01b5)- We've renamed ComplicationUpdateCallback to ComplicationUpdateListener for consistency. (I61ec7)
- The UserStyle wire format map has been changed to
Map<String, byte[]>
and for convenience aUserStyleData
class has been added to the public API and is now used by wear-watchface-client and wear-watchface-editor. In addition CustomValueUserStyleSetting.CustomValueOption.value is nowbyte[]
instead ofString
. (Iaa103) UserStyleSetting
andUserStyleSetting.Option
now useUserStyleSetting.Id
andUserStyleSetting.Option.Id
respectively to store their ids rather than a String. (I63f72)InteractiveWatchFaceClient.SystemState
has been renamed toWatchUiState
. (I6a4e0)InteractiveWatchFaceWcsClient
andInteractiveWatchFaceSysUiClient
have been merged because it was hard to explain the division of responsibility (Iff3fa)- Layer enum values have been renamed for clarity.
Layer#TOP_LAYER
is nowLayer#COMPLICATIONS_OVERLAY
andLayer#BASE_LAYER
is nowLayer#BASE
(Ia144e) UserStyleListener
has been renamed toUserStyleChangeListener
(I18524)UserStyleRepository
has been renamed toCurrentUserStyleRepository
(I6ea53)InteractiveWatchFaceWcsClient.updateInstance
has been renamed toupdateWatchfaceInstance
. (I321dc)- WatchFace TapType events have been renamed to align with MotionEvents / Compose. (I0dfd0)
- takeWatchfaceScreenshot has been renamed to renderWatchFaceToBitmap, and takeComplicationScreenshot has been renamed to renderComplicationToBitmap (Ie0697)
- The CanvasComplication interface has been removed in favor of the open class CanvasComplicationDrawable. (I1f81f)
WatcfaceControlServiceFactory
has been removed from the public api. (I1f8d3)- We've renamed
CanvasComplication.setData
toCanvasComplication.loadData
. (If1239) ComplicationsManager.bringAttentionToComplication
has been renamed todisplayPressedAnimation
. (Ic4297)WatchFaceService.createWatchFace
now has an@UiThread
annotation. (Ib54c2)- Changed the name of a CanvasComplicationDrawable parameter to fix a bug. (I50dac)
- We've added
HeadlessWatchFaceClient.toBundle()
andHeadlessWatchFaceClient.createFromBundle
to support sendingHeadlessWatchFaceClient
over AIDL. (I07c35) - HeadlessWatchFaceClient and InteractiveWatchFaceClient now have ClientDisconnectListener and isConnectionAlive() to allow you to observe if the connection is broken for some reason (e.g. the watchface being killed). (Ie446d)
WatchFaceControlClient#getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClientAsync
is now a suspend function and has been renamed togetOrCreateInteractiveWatchFaceClient
. (Ib745d)EditorState.commitChanges
andhasCommitChanges()
has been renamed toshouldCommitChanges()
. (I06e04)previewComplicationData
has been renamed topreviewComplicationsData
to indicate theres (usually) more than one complication in the map. (I56c06)InteractiveWatchFaceWcsClient.bringAttentionToComplication
has been renamed todisplayPressedAnimation
for consistency withComplicationsManager.displayPressedAnimation
. (Ic9999)- All instances of watchface instance id have been encapsulated in a new WatchFaceId class (I45fdf)
complicationState
property has been renamed tocomplicationsState
to indicate plurality. (Ided07)- We've removed the various wear-watchface-client Binder conversions, they should be necessary. (Icc4c0)
- For consistency
EditorServiceClient
has been refactored to use listeners instead of observers. (Iec3a4) - We've added a couple of missing
@Px
annotations toInteractiveWatchFaceSysUiClient
andWatchFaceControlClient
. (I3277a) - Renamed EditorObserverCallback to EditorObserverListener for consistency. (Ie572d)
- EditorState.watchFaceInstanceId is restricted to Android R API level and above and is no longer nullable. (Id52bb)
EditorSession.launchComplicationProviderChooser
has been renamed toopenComplicationProviderChooser
. (I9d441)EditorSession.createOnWatchEditingSessionAsync
has been renamed tocreateOnWatchEditingSession
and is now a suspend function. (Id257b)- Added several missing
@UiThread
annotations onEditorSession
. (I6935c) UserStyleSetting.affectsLayers
has been renamed toaffectedLayers
. (I6e22b)
Version 1.0.0-alpha10
March 24, 2021
androidx.wear:wear-*:1.0.0-alpha10
is released. Version 1.0.0-alpha10 contains these commits.
New Features
- It’s now possible to create open gl objects (e.g. textures) during WatchFaceService.createWatchFace because GlesRenderer now requires an explicit call to initOpenGLContext which can be done inside createWatchFace.
API Changes
IdAndComplicationData
was a bit awkward and has been removed from the public API. Classes & interfaces that used it have been refactored. (I4c928)- We've replaced
ReferenceTime
withCountUpTimeReference
andCountDownTimeReference
which are more self explanatory. (Ib66c6) - Added some missing
@Px
and@ColorInt
annotations. (I9bbc3) Complication.complicationConfigExtras
is now non-nullable and defaults toBundle.EMPTY
. (Iad04f)GlesRenderer
now requires you to callinitOpenGLContext
after construction. This function was an internal detail but is now on the public API to allow GL calls earlier inside createWatchFace. (I726c2)- We've removed
Complication.setRenderer
as it should not be needed. (Ie992f) Complicaiton.setComplicationBounds
is no longer part of the public API. If you need to adjust the position of a complication, this can be done viaComplicationsUserStyleSetting
. (Ibd9e5)ComplicationsManager.TapCallback.onComplicationSingleTapped
has been renamed toonComplicationTapped
. (I3a55c)ComplicationOutlineRenderer.drawComplicationSelectOutline
has been renamed todrawComplicationOutline
. (I14b88)
Version 1.0.0-alpha09
March 10, 2021
androidx.wear:wear-complications-*:1.0.0-alpha09
and androidx.wear:wear-watchface-*:1.0.0-alpha09
are released. Version 1.0.0-alpha09 contains these commits.
New Features
- The interface between WCS/SysUI host and the on watch face has evolved. It’s now possible for an editor to determine if a style change will enable or disable a complication (enabled = initiallyEnabled plus any override from ComplicationsUserStyleSetting). Also
EditorService.closeEditor
allows SysUI to remotely close an on watch face editor if needed. - In addition
InteractiveWatchFaceWcsClient.setUserStyle
with a more powerful commandupdateInstance
which: changes the instance ID, sets the style, and clears complications all in one go.
API Changes
- TraceEvents have been added to the watchface libraries. (I1a141)
ComplicationState
now has a new propertyinitiallyEnabled
which is useful for predicting the consequences of switching styles. (I8c905)- We've replaced
InteractiveWatchFaceWcsClient.setUserStyle
with a more powerful commandupdateInstance
which: changes the instance ID, sets the style, and clears complications. (Ife6f6) - WatchFaceClient screenshot APIs no longer compress the screenshots because that was slow, instead we leave any post processing up to the caller. (Id35af)
- It's now possible to remotely close an on watchface editor via
EditorService.closeEditor
. (Ic5aa4) - Added nullability annotations (Ic16ed)
Version 1.0.0-alpha08
February 24, 2021
androidx.wear:wear-*:1.0.0-alpha08
is released. Version 1.0.0-alpha08 contains these commits.
New Features
- Some watch faces are designed around one or more specific complications, to support this we’ve added Complication.Builder#setFixedComplicationProvider which if set to true prevents the user from changing the complication in that slot.
- The watchface libraries are Kotlin first and use coroutines (e.g. suspend functions). For Java users we’ve provided ListenableFuture wrappers to improve interoperability in the following libraries: wear/wear-watchface-guava, wear/wear-watchface-client-guava & wear/wear-watchface-editor-guava.
API Changes
- We've removed support for double taps on complications launching the provider chooser, this feature wasn't common in watchfaces and complicated the implementation of SysUI. (I3ef24)
- ProviderInfoRetriever methods may throw ServiceDisconnectedException if the binder closes unexpectedly. (Ib2cc4)
- From Android 11 onwards, there are restrictions on when the ProviderChooser can be run, in addition we'd like editors to be built with the new
wear-watchface-editor
so ComplicationHelperActivity is being removed from the public API. (Ib19c1) - Remove ComplicationText static methods in favor of builders. (Ibe399)
- We have introduced guava ListenableFuture wrappers for the various watch face library suspended methods. (I16b2c)
- For API clarity we've added a secondary constructor to RenderParameters which doesn't require a tint, for use with LayerModes other than
LayerMode.DRAW_OUTLINED
. (I497ea) - Previously ListUserStyleSetting was different from the other because it had a default argument. Now all the StyleSetting subclass constructors take the default value last. (I9dbfd)
- CanvasComplication has been refactored to use have a hidden method, which makes it easier to implement a subclass (I5b321)
- We have refactored away EditorResult in favor of a new EditorService and
EditorSession.broadcastState()
to stream updates to an observer (typically SysUI). (Ic4370) - Some watchfaces are built around a particular complication as an integral part of the watch face where the provider is not user configurable. To support this we've added
Complication.Builder#setFixedComplicationProvider
. (I4509e) - EditorRequest now specifies package name rather than ComponentName because it was inconvenient for SysUI to look up the class name of the editor, and we only really need the package name. (Ib6814)
Version 1.0.0-alpha07
February 10, 2021
androidx.wear:wear-*:1.0.0-alpha07
is released. Version 1.0.0-alpha07 contains these commits.
New Features
- WatchFaceService.createWatchFace is now a suspend function which means the watchface no longer has to block the ui thread while waiting for IO. Similarly wear-watchface-editor and wear-complications-data
API Changes
- Remove PhotoImage class and use Icon directly. (I8a70b)
- Expose the validTimeRange of ComplicationData. (I91366)
- Make image-like attributes more explicit. (I81700)
- wear-watchface-editor and wear-complications-data have been refactored to use suspend functions instead of coroutines. Rx java & Future compat wrappers to follow. (If3c5f)
- ProviderInfoRetriever now now throws PreviewNotAvailableException if requestPreviewComplicationData can't return preview data due to connection issues or lack of API support. (I4964d)
- WatchFaceControlService::createWatchFaceControlClient is now a suspended fuction and getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClient is now called getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClientAsync returning
Deferred<InteractiveWatchFaceWcsClient>
. RX java and Future compat wrappers to follow. (I5d461) - Rename
CATEGORY_PROVIDER_CONFIG_ACTION
toCATEGORY_PROVIDER_CONFIG
. (I7c068) - Please note createOnWatchEditingSession is now a suspended function because the watchface sometimes isn't available until shortly after the editor activity has started. (Ida9aa)
- WatchFaceService.createWatchFace is now a suspend function which allows for async initialization, previously you would have had to block the main thread. (If076a)
- UserStyle now has an array operator and we've added casting helpers to UserStyle.Option. (I35036)
- We've fixed a marshalling bug with UserStyle wireformats changing some of the unstable hidden API. (I8be09)
- We've added CustomValueUserStyleSetting which lets you store a single application specific string within a UserStyle. The default watch face editors will ignore this value. (Ic04d2)
- InstanceID is not passed in the intent extras for R and older versions of Android WearOS which we can't upgrade. To support this we now allow InstancID to be null. (Id8b78)
- EditorRequest now includes the editor ComponentName which is set as the component in WatchFaceEditorContract.createIntent (I3cd06)
- The watchface EditorResult now includes preview ComplicationData to allow the caller to take a screenshot of the watchface after editing. (I2c561)
Bug Fixes
- Added toString() overrides to UserStyle, UserStyleSetting and UserStyleSchema which makes working with these classes a bit nicer. (I9f5ec)
Version 1.0.0-alpha06
January 27, 2021
androidx.wear:wear-*:1.0.0-alpha06
is released. Version 1.0.0-alpha06 contains these commits.
New Features
- We’ve introduced a new library wear/wear-watchface-editor which allows watch face developers and potentially OEMs to build a style and complication editor. SysUI will send an Intent to the watch face which will use the new EditorSession class to access WatchFace details and record the result via Activity.setWatchRequestResult. To support this we’ve added ProviderInfoRetriever.requestPreviewComplicationData which allows watch face editors to request preview ComplicationData. The advantage of preview ComplicationData is unlike live data you don’t have to worry about showing permission dialogs when rendering your editor (note if a user selects a provider with a permission they will still be prompted to grant the permission).
API Changes
- ComplicationProviderInfo now has a field for the provider's ComponentName, support for this field will be added to WearOS at a later date and in the meantime, it will be null. (Id8fc4)
- We've added ProviderInfoRetriever.requestPreviewComplicationData which allows watch face editors to request preview ComplicationData. This is useful because live complications may require permissions and you can now display preview data for complications that are not active. (I2e1df)
- ComplicationManager is now an optional parameter of WatchFace constructor and the arguments have been reordered to allow this. (I66c76)
- We've added an optional Bundle to Complications which if set gets merged in with the intent sent to launch the provider chooser activity. (Ifd4ad)
- We've added a new
wear-watchface-editor
library to support on watch face and SysUi hosted editors. SysUI will launch these editors by sending an intent. The watch face activity service can use the new EditorSession class to access WatchFace details and record the result via Activity.setWatchRequestResult. (I2110d) - LayerMode.DRAW_HIGHLIGHTED is now called LayerMode.DRAW_OUTLINED and RenderParameters.highlightComplicationId is now called RenderParameters.selectedComplicationId which draws a highlight on the specified complication in addition to an outline. (I90a40)
- WatchFaceControlClient.getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClient's future can now resolve with a ServiceStartFailureException if the service dies while waiting for the watchface to be created. (I0f509)
- EditorSession.complicationPreviewData is now a ListenableFuture because fetching this data is an asynchronous process. (Iead9d)
Bug Fixes
- We're removing unused fields from ComplicationOverlay leaving enabled and complicationBounds. (I17b71)
Version 1.0.0-alpha05
January 13, 2021
androidx.wear:wear-*:1.0.0-alpha05
is released. Version 1.0.0-alpha05 contains these commits.
New Features
Watchfaces often support a number of complication configurations with varying numbers of complications shown. To make this easier to set up we now support initially disabled complications by calling setEnabled(false) on the builder. These can be enabled later via ComplicationsUserStyleSetting.
API Changes
- ComplicationHelperActivity now accepts
Collection<ComplicationType>
rather than an int array making it easier to use. (I1f13d) ProviderInfoRetriever.retrieveProviderInfo
now correctly returnsListenableFuture<ProviderInfo[]>
. (If2710)- You can now create an initially disabled complication by calling setEnabled(false) on the builder. (Idaa53)
- WatchFaceState now has an isHeadless property which is only true for headless instances. (Ifa900)
- ComplicationDrawable now optionally supports synchronous loading of drawables. This is used by the screenshot APIs. (I34d4a)
Version 1.0.0-alpha04
December 16, 2020
androidx.wear:wear-*:1.0.0-alpha04
is released. Version 1.0.0-alpha04 contains these commits.
New Features
- The wear watch face library now supports setting bounds per type. E.g. you can switch to a wide bounding box for ComplicationType.LONG_TEXT whilst using a smaller bounding box for other types.
API Changes
- Complications now use ComplicationBounds which wraps a
Map<ComplicationType, RectF>
to support per complication type sizes. (I1ebe7) - RenderParameters now lets you specify the highlight tint for use in screen shots. (Iff42b)
- With the exception of bounds you now have to use ComplicationsUserStyleSetting to modify complications, this is to ensure the OS is kept in sync. (I8dc5d)
- Renderer is now a sealed class. This means CanvasRenderer and GlesRenderer are now inner classes of Renderer. (Iab5d4, b/173803230)
- CanvasComplicationDrawable.drawHighlight renamed to drawOutline. ObservableWatchData now has a few missing UiThread annotations. ScreenState has now been fully removed from WatchState. (If1393)
- The minimum API level for wear-watchface is now 25. Note hardware canvas support requires API level 26 or above. (Ic9bbd)
- InteractiveWatchFaceWcsClient now has a getComplicationIdAt helper. (I05811)
- The API level for wear-watchface-client has been reduced to 25, however the screen shot APIs require API level 27. (Id31c2)
Bug Fixes
- We now expose the complication's current ComplicationData's ComplicationType in ComplicationState. (I9b390)
- InteractiveWatchFaceWcs now has a method `bringAttentionToComplication to briefly highlight the specified complication. (I6d31c)
InteractiveWatchFaceWcsClient#setUserStyle
now has an overload accepting Mapwhich can potentially avoid an extra IPC round trip necessary to construct UserStyle. (I24eec)
Version 1.0.0-alpha03
December 2, 2020
androidx.wear:wear-*:1.0.0-alpha03
is released. Version 1.0.0-alpha03 contains these commits.
New Features
The Complication class now has a compicationData property letting watch faces observe ComplicationData changes. This makes it possible to change the complication’s dimensions based on the type of the complication.
Variable frame rates are now supported by assigning to Renderer.interactiveDrawModeUpdateDelayMillis. For watch faces which run short animations every second this can lead to good power savings by going to sleep when not animating.
API Changes
BACKGROUND_IMAGE
has been renamed toPHOTO_IMAGE
along with related classes. This type of complication is not exclusively used for backgrounds hence the name change. (I995c6)- DefaultComplicationProviderPolicy properly annotated with IntDefs. (I3b431)
- The hidden TimeDependentText class is no longer exposed via ContentDescriptionLabel, instead we add an accessor to get the text at a specified time. (Ica692)
- ObservableWatchData's constructor is now internal. (I30121, b/173802666)
- Complication now has compicationData letting watch faces observe ComplicationData changes. Complication also has a new isActiveAt call which can be used to tell if anything should be rendered at the provided datetime. (Ic0e2a)
- The empty
SharedMemoryImage
is no longer in the public API. (I7ee17) WatchFace.overridePreviewReferenceTimeMillis
now has an IntRange annotation and the getter and setter have consistent names. (Ia5f78)Complication.Builder
is now created viaComplication.createRoundRectComplicationBuilder
orComplication.createBackgroundComplicationBuilder
for clarity (I54063)- Added WatchFace.TapListener which allows taps not consumed by complications to be observed by the WatchFace. (Ic2fe1, b/172721168)
- WatchFace now supports variable frame rates by assigning to
Renderer.interactiveDrawModeUpdateDelayMillis
. This can help preserve battery life by sleeping when not animating. (I707c9) - WatchFace.Builder is no longer needed and invalidate() and interactiveUpdateRateMillis have been moved to Renderer. (I329ea)
- For better java interoperability renamed getters for boolean properties in WatchState (I6d2f1)
- Renamed TapListener to TapCallback and InvalidateCallback to InvalidateListener for consistency. (I9414e)
- Wear 2.0 watchface style options have been moved to their own class for clarity. WatchFace.Builder setters now have symmetrical WatchFace class getters. (Iefdfc)
- Added InteractiveWatchFaceWcsClient and
WatchFaceControlClient.getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClient
which either gets an existing instance or creates it once the wallaper service has connected and made the engine. (Id666e) - WatchFaceControlClient is now an interface to allow tests to mock it. (I875d9)
- HeadlessWatchFaceClient, InteractiveWatchFaceSysUiClientImpl, InteractiveWatchFaceWcsClient are now interfaces to better facilitate testing. (I7cdc3)
- Added annotations to methods in
wear-watchface-complications-rendering
(I0d65c)
Bug Fixes
- Remove screen shape from DeviceConfig, which was duplicating
android.content.res.Configuration#isScreenRound()
(Ifadf4) - Changed
WatchFaceControlClient.getOrCreateWallpaperServiceBackedInteractiveWatchFaceWcsClient
to accept aMap<String, String>
instead ofUserStyle
because it's hard to create aUserStyle
without knowing the schema which you can only get after the client has been created. (Iea02a) - Fix
InteractiveWatchFaceWcsClient
to useComplicationState
instead of the wire format. (Icb8a4) UserStyleSettings
is now a sealed class because the watch face editors only understand the built in classes. (I2d797)
Version 1.0.0-alpha02
November 11, 2020
androidx.wear:wear-*:1.0.0-alpha02
is released. Version 1.0.0-alpha02 contains these commits.
API Changes
ComplicationDetails
is now calledComplicationState
and is properly wrapped and usages of wearable support@ComplicationData.ComplicationType
have been migrated to androidxComplicationType
. (I4dd36)- Add an optional
highlightedComplicationId
parameter to RenderParameters which allows you to request highlighting of a single complication in screenshots. (I66ce9) ComplicationProviderService
to use new style complication api for consistency (Id5aea)getPreviewReferenceTimeMillis
now gets reference times fromDeviceConfig
. (I779fe)- Simplifying Renderer API surface, can use
SurfaceHolder.Callback
to observe changes instead. (I210db) CanvasComplicationRenderer
doesn't extend fromRenderer
, renaming it for clarity. (Ibe880)
Bug Fixes
- First version of
androidx.wear:wear-watchface-client
(I1e35e) - Changed the name of
GlesTextureComplication#renderer
for clarity (Ib78f7) - Rename
StyleCategory
toStyleSetting
for clarity (I488c7) - Adding
UserStyleSchema
for a cleaner API (If36f8)
Version 1.0.0-alpha01
October 28, 2020
androidx.wear:wear-complications-*:1.0.0-alpha01
and androidx.wear:wear-watchface-*:1.0.0-alpha01
are released. Version 1.0.0-alpha01 contains these commits.
API Changes
- Removed some things we didn't intend to expose in public api. (I41669)
- Create
androidx.wear:wear-complications-provider
library. (I77f1f) - ComplicationsUserStyleCategory the new recommended category for configuring complications (I96909)
- Add wear-complication-data API. (I7c268)
- Functions with boolean return values to be prefixed with “is” rather than “get” (If36ff)
- API advice is to avoid using protected so this class has been refactored to take parameters in via the constructor. (I61644)
- Rename setBackgroundComplication for clarity. (I96fe3)
- Use Kotlin properties for ComplicationDrawable isHighlighted & data (I4dcc8)
- Instead of ComplicationRenderer.InvalidateCallback we add Complication#invalidate() (I4f4c6)
- These APIs are being deprecated in WearableSupport and are removed here. (Ib425c)
- Renamed some WatchFace builder methods to emphasize their wear 2.0 legacy nature. (Idb775)
- First beta API candidate for wear/wear-watchface (Id3981)
- First tracked version of the API. (Ie9fe6)
- Properly hiding ComplicationDrawable.BorderStyle IntDef and move to ComplicationStyle for consistency. (I27f7a)
- Adding missing annotations for ComplicationStyle methods (I838fd)
- This library has no public API surface (I88e2b)
- All style category Option classes are now properly final. (Ib8323)
- First tracked version of the API. (I27c85)
Bug Fixes
- Changed ComplicationProviderService to have an explicit getComplicationPreviewData method. (I4905f)
- API lint check for MissingGetterMatchingBuilder is enabled for androidx (I4bbea, b/138602561)
- Rename wear-complications-rendering. (Ifea02)
- Style category display names are now CharSequences (I28990)
- Replacing Override with Overlay to match current themes & styles naming conventions. (I4fde9)
- Renamed UserStyle#getOptions for clarity. (I695b6)
Version 1.2.0
Version 1.2.0-alpha07
March 24, 2021
androidx.wear:wear:1.2.0-alpha07
is released. Version 1.2.0-alpha07 contains these commits.
Bug Fixes
- Fixing errors with non-curved children inside of WearArcLayout caused by using screen size with height bigger than width. These non-curved children are now correctly placed inside of an arc on all screen types.
Version 1.2.0-alpha06
January 27, 2021
androidx.wear:wear:1.2.0-alpha06
is released. Version 1.2.0-alpha06 contains these commits.
API Changes
- Migrate the Ongoing Activities library to a new sub-library: wear-ongoing. Classes now live in the androidx.wear.ongoing package (previously was androidx.wear.ongoingactivities) (I7c029)
- Migrate WearableCalendarContract class from Wearable Support Library to AndroidX. This API provides a subset of the data available through CalendarContract, but is automatically synced to wearable devices. (I6f2d7)
Bug Fixes
- Disable the back button dismiss feature by default in Dismissible FrameLayout since swipe-to-dismiss remains as the main way to navigate back a full screen on Wearable devices (Ic24e3)
- Fixed some issues handling children visibility on WearArcLayout (Icf912)
Version 1.2.0-alpha05
January 13, 2021
androidx.wear:wear:1.2.0-alpha05
is released. Version 1.2.0-alpha05 contains these commits.
Bug Fixes
- Update the javadoc of AmbientModeSupport class to provide sample snippets to better demonstrate the general use of this class.
Version 1.2.0-alpha04
December 16, 2020
androidx.wear:wear:1.2.0-alpha04
is released. Version 1.2.0-alpha04 contains these commits.
API Changes
- Added support for indicating that an Activity can be “auto-resumed” when the device leaves ambient mode in the AmbientModeSupport class. This functionality was previously available in the deprecated WearableActivity class from WearableSupportLibrary. (I336ab)
- OngoingActivity
- Category can now be set when creating an OngoingActivity, e.g.
OngoingActivitiy.Builder.getCategory(String)
- OngoingActivityData now has a timestamp of when the OngoingActivity was built -
OngoingActivityData.getTimestamp()
- (I91cb4)
- Category can now be set when creating an OngoingActivity, e.g.
- Added support for setting margins on children of WearArcLayout by changing the layout params to extend MarginLayoutParams, i.e. WearArcLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams. (I2cd88)
- Change WearCurvedTextView's anchor type default to
WearArcLayout.ANCHOR_CENTER
(wasWearArcLayout.ANCHOR_START
). This simplifies the contract between the arc layout and the curved text as the curved text by default draws itself x-centered at the top, and the parent arc layout can rotate it to where it needs to be. (I105ff)
Version 1.2.0-alpha03
December 2, 2020
androidx.wear:wear:1.2.0-alpha03
is released. Version 1.2.0-alpha03 contains these commits.
New Features
A new layout container DismissibleFrameLayout, which handles back-button-dismiss and/or swipe-to-dismiss, intended for use within an activity. At least one listener must be added to act on a dismissal action. A listener will typically remove a containing view or a fragment from the current activity. setSwipeDismissible(boolean) & setBackButtonDismissible(boolean) are provided for direct control over the features. This new layout is meant to replace the existing SwipeDismissFrameLayout.
Curved widgets now handle touch events. Normal widgets inside an WearArcLayout will receive all touch events, mapped to their coordinate space. WearCurvedTextView (inside an WearArcLayout or not) can set onClick and onLongClick handlers.
Ongoing activities classes are now VersionedParcelables instead of using custom serialization/deserialization. The static icon and touch intent are now required.
API Changes
- The attribute "sweepDegrees" for WearCurvedTextView is separated into minSweepDegrees and maxSweepDegrees to give a more flexible layout of this widget.
Version 1.2.0-alpha02
November 11, 2020
androidx.wear:wear:1.2.0-alpha02
is released. Version 1.2.0-alpha02 contains these commits.
This release adds a new “Ongoing Activities API” for the first time. This API can be used by developers to signal that a long running activity, such as a fitness exercise or a media playback session is on-going. It allows developers to provide periodic status updates such as “distance and time run” or “current track playing” for display on the watch face or in the app launcher. This functionality is targeted at future devices with the on-going activity functionality enabled.
API Changes
- New API for Ongoing Activities, this is a no-op on "unsupported devices.". (I69a31)
Version 1.2.0-alpha01
October 28, 2020
androidx.wear:wear:1.2.0-alpha01
is released. Version 1.2.0-alpha01 contains these commits.
New Features
- Added WearCurvedTextView component for easily writing curved text following the curvature of the largest circle that can be inscribed in the view. An usage example:
<androidx.wear.widget.WearCurvedTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="example curved text"
app:anchorAngleDegrees="180"
app:anchorPosition="center"
app:clockwise="false"
style="@android:style/TextAppearance.Large"
/>
- Added WearArcLayout container for laying out its child elements one by one on an arc in either the clockwise or counterclockwise direction. Its children can be both standard android widget or "curved" widgets which implement its ArcLayoutWidget interface. An usage example:
<androidx.wear.widget.WearArcLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:anchorPosition="center">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_launcher"
/>
<androidx.wear.widget.WearCurvedTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Curved Text"
style="@android:style/TextAppearance.Small"
android:padding="2dp"
/>
</androidx.wear.widget.WearArcLayout>
(I536da)
Wear-Input 1.1.0
Version 1.1.0-alpha01
January 27, 2021
androidx.wear:wear-input:1.1.0-alpha01
and androidx.wear:wear-input-testing:1.1.0-alpha01
are released. Version 1.1.0-alpha01 contains these commits.
API Changes
- Migrate RemoteInputIntent class from Wearable Support Library to AndroidX. The migrated class is renamed as RemoteInputIntentHelper which provides helper functions for supporting remote inputs through starting an intent. (I47cee)
Wear-Input 1.0.0
Version 1.0.0
December 2, 2020
androidx.wear:wear-input:1.0.0
and androidx.wear:wear-input-testing:1.0.0
are released. Version 1.0.0 contains these commits.
This release is identical to 1.0.0-rc01
.
Major features of 1.0.0
Migration of WearableButtons functionality from Wearable Support Library to Jetpack.
Added
androidx.wear.input.test.TestWearableButtonsProvider
which implementsandroidx.wear.input.WearableButtonsProvider
to aid testing applications developed withandroidx.wear:wear-input
library.
Version 1.0.0-rc01
November 11, 2020
androidx.wear:wear-input:1.0.0-rc01
and androidx.wear:wear-input-testing:1.0.0-rc01
are released. Version 1.0.0-rc01 contains these commits.
This release is identical to 1.0.0-beta01
.
Version 1.0.0-beta01
October 28, 2020
androidx.wear:wear-input:1.0.0-beta01
and androidx.wear:wear-input-testing:1.0.0-beta01
are released with no changes since 1.1.0-alpha01
. Version 1.0.0-beta01 contains these commits.
Wear-Input-Testing Version 1.0.0-alpha01
October 14, 2020
androidx.wear:wear-input-testing:1.0.0-alpha01
is released. Version 1.0.0-alpha01 contains these commits.
API Changes
- Added
androidx.wear.input.test.TestWearableButtonsProvider
which implementsandroidx.wear.input.WearableButtonsProvider
to aid testing applications developed withandroidx.wear:wear-input
library. (I0ed0c)
Wear-Input Version 1.0.0-alpha01
September 2, 2020
androidx.wear:wear-input:1.0.0-alpha01
is released. Version 1.0.0-alpha01 contains these commits.
New Features
Migration of WearableButtons functionality from Wearable Support Library to Jetpack. Additional testing support will be provided in androidx.wear:wear-input-testing
library in the next Jetpack release.
Version 1.1.0
Version 1.1.0
October 14, 2020
androidx.wear:wear:1.1.0
is released. Version 1.1.0 contains these commits.
Major changes since 1.0.0
- Added a
layout_
prefix to boxedEdges attribute (nowlayout_BoxedEdges
) forBoxInsetLayout
in order to comply with android naming convention. This will remove the linter error in Android Studio for these attributes. (I4272f) - Added optional
EXTRA_ANIMATION_DURATION_MILLIS
toConfirmationActivity
to allow for the duration that the confirmation dialog is displayed. (adb83ce, b/143356547) - Updated
WearableActionDrawView
to delay action drawer inflation until the drawer is opened for the first time. (I01026, b/163870541)
Version 1.1.0-rc03
September 2, 2020
androidx.wear:wear:1.1.0-rc03
is released. Version 1.1.0-rc03 contains these commits.
Bug Fixes
- Fixed issue with Action Drawer not showing content when it is opened. (I01026, b/163870541)
Version 1.1.0-rc02
June 24, 2020
androidx.wear:wear:1.1.0-rc02
is released. Version 1.1.0-rc02 contains these commits.
Bug Fixes
- Added a
layout_
prefix to boxedEdges attribute (nowlayout_boxedEdges
) forBoxInsetLayout
in order to comply with android naming convention. This will remove the linter error in Android Studio for these attributes.
Version 1.1.0-rc01
May 14, 2020
androidx.wear:wear:1.1.0-rc01
is released with no changes since .1.0-beta01
. Version 1.1.0-rc01 contains these commits.
Version 1.1.0-beta01
April 29, 2020
androidx.wear:wear:1.1.0-beta01
is released with no changes since androidx.wear:wear:1.1.0-alpha01
. Version 1.3.0-beta01 contains these commits.
Version 1.1.0-alpha01
April 15, 2020
androidx.wear:wear:1.1.0-alpha01
is released. Version 1.1.0-alpha01 contains these commits.
API Changes
- Added optional
EXTRA_ANIMATION_DURATION_MILLIS
toConfirmationActivity
to allow for the duration that the confirmation dialog is displayed. (adb83ce, 134523c, b/143356547)
Bug Fixes
- Updated
WearableActionDrawView
to delay action drawer inflation until the drawer is opened for the first time. (5cd32f7)