Demonstrates a simple "Hello, World" starter project for using Compose with Wear OS.
Simple "Hello, World" app meant as a starting point for a new project using Compose for Wear OS.
Displays a centered [Text] composable and a list built with Horologist.
For more information on composable options in Compose for Wear OS, check out our documentation.
This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.
This sample demonstrates two techniques for helping you design for different display sizes:
-
Compose
WearPreviewDevices
andWearPreviewFontScales
annotations: These generate a set of previews in the preview pane within Android Studio, for a range of different screen sizes and font display size settings, allowing you to see how your design would look. -
Screenshot tests: This sample also demonstrates screenshot testing, for a set of defined devices. For more information on screenshot testing, see this talk from droidcon London, and see the Continuous Integration for more details on how to build screenshot testing into your automated workflows.
- To generate new images for the tests, run
./gradlew recordRoborazziDebug
- To test against existing reference images, run
./gradlew verifyRoborazziDebug
- To generate new images for the tests, run
Together, this allows you to check for any unexpected visual changes to your UI, across a range of device sizes.
- Stack Overflow: https://stackoverflow.com/questions/tagged/wear-os
If you've found an error in this sample, please create an issue.
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.