Skip to content

Latest commit

 

History

History

ComposeStarter

Compose for Wear OS Starter Sample

Demonstrates a simple "Hello, World" starter project for using Compose with Wear OS.

Introduction

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.

Screenshots

Round Screenshot

Getting Started

This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.

Designing for different display sizes

This sample demonstrates two techniques for helping you design for different display sizes:

  1. Compose WearPreviewDevices and WearPreviewFontScales 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.

  2. 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.

    • To generate new images for the tests, run ./gradlew recordRoborazziDebug
    • To test against existing reference images, run ./gradlew verifyRoborazziDebug

Together, this allows you to check for any unexpected visual changes to your UI, across a range of device sizes.

Support

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.