Skip to content

Latest commit

 

History

History

WearTilesKotlin

Wear Tiles Sample

Tiles provide easy access to the information and actions users need in order to get things done. With a simple swipe from the watch face, a user can find out the latest forecast or start a timer.

This repository contains a sample tile built using the Tiles Material Components library (for UI) and Horologist Tiles (preview utilities and Kotlin-friendly wrappers).

It also showcases most of the Golden Tile layouts from the Tiles Design Kit in the tiles.golden package of the debug sourceset. To see what these look like, open one of the "GoldenTilesPreviewsRowN" files and choose the "Split" or "Design" editor view.

Screenshot of Android Studio showing the design view of GoldenTilesPreviewsRow1.kt. A grid view of Wear OS Tiles are displayed.

Get Started

Build the project from the command line using ./gradlew build or import it into Android Studio to benefit from the IDE shortcuts like direct surface launching which lets you launch the Messaging tile directly to a device or emulator in just one click.

Layout samples from the Tiles Design Kit can be found in GoldenTilesPreviewsRow[N].kt. Open the file in "Split" or "Design" mode to view the previews without a device or emulator.

For the sample, start with MessagingTileService.kt; the layout (with IDE preview) can be found in MessagingTileLayout.kt.

Support

If you've found an error in this sample, please file an issue: https://github.com/android/wear-os-samples

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.