This repository provides sample code demonstrating how to update tiles and create tile UIs.
Note: Tiles will not update after building and running the app. You need to remove and re-add the tile to see the updates.
Simply displays "Hello World!".
This is a Count Up tile. It actually displays the seconds part of the current time. Uses Dynamic Expression.
A new column is added every 60 seconds. Creates multiple TimelineEntry objects.
Displays the current time but updates only every 60 seconds.
Uses setFreshnessIntervalMillis()
.
Displays the current time but updates only every 60 seconds. Intended for external updates. Important: In a production environment, do not use GlobalScope. Use WorkManager or other appropriate tools instead. Updates continue for 10 minutes after adding the tile.
The image is fetched remotely. The Renderer class is used for this purpose.
As of July 2024, dynamic expressions are not supported in Android Glance. Additionally, TimelineEntry is currently limited to a single entry. It seems better to stick to simple tiles or experimental use for now. If you have any good tips on how to make the most of Glance, please let me know.
catalog of layouts. It's generally recommended to refer to the official WearTilesKotlin samples. The layout switches when click on it.
wear-os-samples/WearTilesKotlin at main · android/wear-os-samples wear-os-samples/WearTilesKotlin/app/src/debug/java/com/example/wear/tiles/golden at main · android/wear-os-samples