Skills

Wear Widgets

Create, migrate, update, and verify Wear OS widgets using Glance Wear and Remote...

Install

npx skills add android/skills --skill wear-widgets -g -a claude-code -y
Repository
android/skills10.2k
Category
Design
Updated
6d ago
License
Complete terms in LICENSE.txt
Context cost
Mediumabout 2,968 tokens
Runs scripts
No, instructions only

What it does

Create, migrate, update, and verify Wear OS widgets using Glance Wear and Remote Compose in an Android project. Use this skill when implementing GlanceWearWidget, GlanceWearWidgetService, WearWidgetDocument, Remote Compose UI primitives (RemoteColumn, RemoteRow, RemoteBox, RemoteText, RemoteImage, RemoteButton), local state with rememberMutableRemoteInt and valueChange, click actions with pendingIntentAction, widget provider XML containers (SMALL and LARGE), rectangular widget picker PNG previews, or migrating legacy ProtoLayout TileService tiles to Wear OS widgets. Don't use for mobile home screen AppWidgetProvider or GlanceAppWidget implementations, watch face complications, or full-screen Wear OS activities.

Wear OS widgets use androidx.glance.wear (GlanceWearWidget and GlanceWearWidgetService) with androidx.compose.remote (Remote Compose). They serialize declarative UI and state documents to the watch host process.

Prerequisites and setup

  1. Resolve library versions : Resolve the latest versions for {GLANCE_WEAR_VERSION} (androidx.glance.wear), {COMPOSE_REMOTE_VERSION} (androidx.compose.remote), and {WEAR_COMPOSE_REMOTE_VERSION} (androidx.wear.compose.remote). Include -alpha, -beta, or -rc releases when no stable version exists yet. Don't run ./gradlew dependencies to resolve versions:
  2. SDK and Compose compiler requirements : Ask permission before modifying repo-wide Gradle files unless the user requested widget creation, tile migration, or dependency setup. Set compileSdk = 37 or higher and enable buildFeatures { compose = true }. Keep the project's existing Android and Kotlin Gradle plugin declarations intact.
Read the whole SKILL.md on GitHub

More in Design