Generated banner for Wear Compose M3
Generated logo for Wear Compose M3

Wear Compose M3

Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • No issues found

From the author

Guidance for Wear OS Compose Material3 (Wear Compose Material 3 / Wear Compose Material3) watch and wearable apps. Covers creating, updating, and migrating projects (Material 2.5 and Horologist migration) using androidx.wear.compose.material3, androidx.wear.compose.foundation, and androidx.wear.compose.navigation3, including AppScaffold, ScreenScaffold, TransformingLazyColumn, ambient mode, and previews.
— the description by Google LLC

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides essential guidance for developers building or migrating Wear OS applications to the Material 3 (M3) design system. It covers the integration of androidx.wear.compose.material3, foundation, and navigation libraries, offering best practices for component usage, project migration from Material 2.5 or Horologist, and implementation of key Wear OS features like ambient mode and scaffold structures.

What it does

  • Provides migration paths from Material 2.5 and Horologist to Wear Compose M3.
  • Defines mandatory project configuration for Kotlin, Compose compiler, and SDK versions.
  • Maps legacy components to their modern M3 equivalents.
  • Offers a comprehensive reference table for canonical component samples.
  • Guides developers on implementing scaffold structures and ambient mode.
  • Enforces strict versioning and build validation protocols.

When to use it

  • When starting a new Wear OS project using Compose Material 3.
  • When migrating an existing Wear OS app from Material 2.5 or Horologist.
  • When updating dependencies for Wear Compose libraries.
  • When looking for canonical implementation samples for M3 components.

Advantages

  • Ensures consistency with official Google Material 3 design standards.
  • Reduces migration friction through clear component mapping.
  • Promotes stable build practices by enforcing version compliance.
  • Centralizes access to verified component samples and implementation patterns.

Usage examples

“How do I migrate my Wear OS app from Material 2.5 to Material 3?”
The agent will guide you through updating your dependencies, replacing legacy components like Chip with Button, and updating your MaterialTheme implementation to use ColorScheme and MotionScheme.
“What is the M3 equivalent for ScalingLazyColumn?”
The agent will advise using TransformingLazyColumn and provide links to the relevant samples for implementation.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/android/wear-compose-m3/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip wear-compose-m3.zip -d .agents/skills

Documentation by Google LLC

Prerequisites and compatibility

  1. Current Wear OS Compose version in-use: To find the installed library version, read gradle/libs.versions.toml or build.gradle.kts directly. Don't run ./gradlew dependencies or other shell commands to resolve versions.

  2. Wear OS Compose Material3 version: If an internal tool is available to establish the latest stable version {VERSION} of androidx.wear.compose:compose-material3, use that tool.

  3. Strict compliance: If a version is listed as stable, you MUST use it, unless overridden by the user. Do not downgrade based on initial "Unresolved reference" errors in the editor or outdated web search results.

  4. Kotlin & Compose compiler: Use Kotlin 2.0.0+ with the org.jetbrains.kotlin.plugin.compose Gradle plugin.

  5. Min SDK: Ensure minSdk is at least 25.

  6. Compile SDK & AGP: Ensure compileSdk and AGP meet the library's AAR metadata floors (compileSdk >= 35 and AGP >= 8.6.0 for 1.6.x; compileSdk >= 37 and AGP >= 9.1.0 for 1.7.x).

Gotchas

  1. Mandatory sync and validation: After updating versions in libs.versions.toml or build.gradle.kts, perform a Gradle sync (or ./gradlew assembleDebug) before refactoring, and run ./gradlew assembleDebug after refactoring to verify the build.

  2. Prohibition of guessing (error protocol): If you encounter an 'Unresolved Reference' or API mismatch after a successful sync, do not attempt to 'fix' it by downgrading the library version.

Capabilities and tools

Capability 1: Migration, updates, and adding features

Use this guidance when migrating from an older version of Wear OS Compose or Horologist, updating an existing Wear Compose Material3 project, or adding features.

  1. Unless otherwise indicated by the developer, use the latest stable version of Wear Compose Material3 from {VERSION} (superseding any literal version strings in the migration guide).

  2. When migrating from Material 2.5 or Horologist, read the migration guide and use its official component mappings.

  3. Before refactoring any component (for example, Chip -> Button), check the parameter names, slot types, and "Expressive" design tokens.

  4. Do not use the Horologist Composables, Compose Layout, or Compose Material libraries; replace Horologist components with Wear Compose M3 equivalents (AppScaffold -> M3 AppScaffold, ScreenScaffold -> M3 ScreenScaffold, ScalingLazyColumn -> TransformingLazyColumn, ResponsiveListHeader -> ListHeader, PagerScreen -> HorizontalPagerScaffold, Chip -> Button, Confirmation -> ConfirmationDialog).

  5. Always check against the component guidance in Capability 3.

  6. Expect screenshot tests to fail when migrating or updating components: expected defaults for padding and positioning will have changed. Do not seek to artificially match the previous screenshot, but give preference to the Material3 defaults.

Capability 2: Component samples

Use this table of reference to find canonical samples for Wear Compose components. When working with a Wear Compose component, you must use the samples linked from the table to ensure you know how to correctly use it.

Important: Symbols marked with [alpha], [beta], or [rc] are only available in that pre-release track and are not in stable {VERSION}. Do not use them unless the project explicitly targets that pre-release version.

Material 3 components in androidx.wear.compose.material3.*
Component / SymbolReference Samples
AlertDialog, AlertDialogDefaultsAlertDialogSample
AnimatedPage, HorizontalPagerScaffold, VerticalPagerScaffoldOneHandedGestureSamples, PageIndicatorSample, PagerScaffoldSample
AnimatedText, rememberAnimatedTextFontRegistryAnimatedTextSample
AppCardCardSample
AppScaffoldListHeaderSample, PagerScaffoldSample, ScaffoldSample, SurfaceTransformationSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample
ArcProgressIndicator, ArcProgressIndicatorDefaults, CircularProgressIndicator, CircularProgressIndicatorDefaults, ProgressIndicatorDefaults, SegmentedCircularProgressIndicator, drawCircularProgressIndicatorProgressIndicatorSample
ButtonAlertDialogSample, AnimatedTextSample, ButtonGroupSample, ButtonSample, DatePickerSample, DynamicColorSchemeSample, FadingExpandingLabelSample, ListHeaderSample, OneHandedGestureSamples, PageIndicatorSample, PagerScaffoldSample, PickerSample, ScaffoldSample, ScrollIndicatorSample, StepperSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TimePickerSample, TransformationSpecSample, TransformingLazyColumnSample, TransformingLazyColumnSample
ButtonDefaultsButtonSample, CurvedTextSamples, DynamicColorSchemeSample, EdgeButtonSample, ListHeaderSample, OneHandedGestureSamples, PlaceholderSample, ScaffoldSample, ScrollAwaySample, ScrollIndicatorSample, SurfaceTransformationSample, TextButtonSample, TransformationSpecSample, TransformingLazyColumnSample, TransformingLazyColumnSample
ButtonGroupButtonGroupSample, TransformationSpecSample
CardCardSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformingLazyColumnSample
CardDefaultsCardSample, SurfaceTransformationSample, SwipeToRevealSample, TransformingLazyColumnSample, TransformingLazyColumnSample
CheckboxButtonCheckboxButtonSample, SwipeToDismissBoxSample
ChildButton, OutlinedButtonButtonSample
ColorScheme, dynamicColorSchemeDynamicColorSchemeSample
CompactButton, CompactButtonDefaultsButtonSample, TransformingLazyColumnSample
ConfirmationDialog, ConfirmationDialogDefaults, FailureConfirmationDialog, SuccessConfirmationDialog, confirmationDialogCurvedTextConfirmationDialogSample
CurvedTextDefaultsCurvedTextSamples
DatePicker, DatePickerTypeDatePickerSample
EdgeButtonEdgeButtonSample, OneHandedGestureSamples, ScaffoldSample, SwipeDismissableSceneStrategySample, TransformingLazyColumnSample
EdgeButtonSizeEdgeButtonSample
FadingExpandingLabelFadingExpandingLabelSample
FilledIconButton, FilledTonalIconButton, IconButtonColors, IconButtonShapes, OutlinedIconButtonIconButtonSample
FilledTonalButtonAlertDialogSample, ButtonSample, ConfirmationDialogSample, OpenOnPhoneDialogSample, PlaceholderSample, ScrollAwaySample, SwipeToDismissBoxSample
HorizontalPageIndicator, VerticalPageIndicatorPageIndicatorSample
IconAlertDialogSample, ButtonSample, CardSample, CheckboxButtonSample, ConfirmationDialogSample, CurvedTextSamples, DatePickerSample, EdgeButtonSample, IconButtonSample, ListHeaderSample, PlaceholderSample, ProgressIndicatorSample, RadioButtonSample, SwipeToRevealSample, SwitchButtonSample, TimePickerSample
IconButtonIconButtonSample, LevelIndicatorSample, ProgressIndicatorSample
IconButtonDefaultsIconButtonSample, ProgressIndicatorSample
IconToggleButton, IconToggleButtonDefaultsIconToggleButtonSample
LevelIndicatorLevelIndicatorSample
LinearProgressIndicatorLinearProgressIndicatorSample
ListHeaderListHeaderSample, ScrollAwaySample, SwipeDismissableSceneStrategySample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample
ListHeaderDefaultsListHeaderSample, ScrollAwaySample, TransformingLazyColumnSample
ListSubHeaderListHeaderSample
LocalOneHandedGestureEnabled, OneHandedGestureDefaults, OneHandedGestureHorizontalPageIndicator, OneHandedGesturePageIndicatorState, OneHandedGesturePriority, OneHandedGestureScrollIndicator, OneHandedGestureScrollIndicatorState, OneHandedGestureVerticalPageIndicatorOneHandedGestureSamples
MaterialThemeAlertDialogSample, ButtonSample, CardSample, CurvedTextSamples, DynamicColorSchemeSample, LinearProgressIndicatorSample, PagerScaffoldSample, ProgressIndicatorSample, SwipeToDismissBoxSample, TimeTextSample, TransformingLazyColumnNotificationsSample
OneHandedGestureAction, OneHandedGestureClickIndicator, OneHandedGestureClickIndicatorState, oneHandedGesture, rememberOneHandedGestureConfigurationButtonSample, CardSample, OneHandedGestureSamples
OpenOnPhoneDialog, OpenOnPhoneDialogDefaults, openOnPhoneDialogCurvedTextOpenOnPhoneDialogSample
OutlinedCardCardSample, TransformingLazyColumnSample
PagerScaffoldDefaultsPageIndicatorSample, PagerScaffoldSample
PickerPickerSample
PickerGroupPickerGroupSample
RadioButton, SplitRadioButtonRadioButtonSample
ResponsiveTransformationSpec, TransformationVariableSpecSurfaceTransformationSample, TransformationSpecSample
RevealValue, SwipeToReveal, SwipeToRevealDefaults, rememberRevealStateSwipeToRevealSample
ScreenScaffoldListHeaderSample, OneHandedGestureSamples, PagerScaffoldSample, ScaffoldSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample
ScreenScaffoldDefaults, ScrollIndicatorScrollIndicatorSample
ScreenStage, scrollAwayScrollAwaySample
Slider, SliderDefaultsSliderSample
SplitCheckboxButtonCheckboxButtonSample
SplitSwitchButtonSwitchButtonSample
Stepper, StepperLevelIndicator, rangeSemanticsStepperSample
StepperDefaultsLevelIndicatorSample, StepperSample
SurfaceTransformationAlertDialogSample, DynamicColorSchemeSample, ListHeaderSample, ScaffoldSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, TransformationSpecSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample, TransformingLazyColumnSample
SwipeToDismissBoxSwipeToDismissBoxSample
SwitchButtonAlertDialogSample, OneHandedGestureSamples, SwitchButtonSample
TextAlertDialogSample, AnimatedTextSample, ButtonGroupSample, ButtonSample, CardSample, CheckboxButtonSample, ConfirmationDialogSample, DatePickerSample, DynamicColorSchemeSample, EdgeButtonSample, ListHeaderSample, OneHandedGestureSamples, OpenOnPhoneDialogSample, PageIndicatorSample, PagerScaffoldSample, PickerGroupSample, PickerSample, PlaceholderSample, RadioButtonSample, ScaffoldSample, ScrollAwaySample, ScrollIndicatorSample, StepperSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToDismissBoxSample, SwipeToRevealSample, SwitchButtonSample, TextButtonSample, TextToggleButtonSample, TimePickerSample, TransformationSpecSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample
TextButtonTextButtonSample
TextButtonDefaultsTextButtonSample, TextToggleButtonSample
TextToggleButton, TextToggleButtonDefaults, touchTargetAwareSizeTextToggleButtonSample
TimePicker, TimePickerTypeTimePickerSample
TimeTextScrollAwaySample, ScrollIndicatorSample, TimeTextSample
TimeTextDefaults, timeTextCurvedTextTimeTextSample
TitleCardCardSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample
TransformationSpecTransformationSpecSample
curvedTextCurvedTextSamples, ScrollAwaySample, TimeTextSample
firstVisibleItemLayoutItemInfo, layoutItemInfoOf, rememberTransformingLazyColumnFirstLayoutItemProviderTransformingLazyColumnSample
placeholder, placeholderShimmer, rememberPlaceholderStatePlaceholderSample
rememberPickerStatePickerGroupSample, PickerSample
rememberTransformationSpec, transformedHeightAlertDialogSample, DynamicColorSchemeSample, ListHeaderSample, ScaffoldSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformationSpecSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample, TransformingLazyColumnSample
timeTextSeparatorScrollAwaySample, TimeTextSample
Foundation components in androidx.wear.compose.foundation.*
Component / SymbolReference Samples
AmbientMode, LocalAmbientModeManager, rememberAmbientModeManagerAmbientModeSample, OneHandedGestureSamples
AmbientTickEffectAmbientModeSample
BasicSwipeToDismissBoxSwipeToDismissBoxSample
CurvedAlignment, CurvedTextStyle, angularGradientBackground, angularSize, basicCurvedText, clearAndSetSemantics, curvedColumn, padding, radialGradientBackground, radialSize, semantics, sizeCurvedWorldSample
CurvedDirection, CurvedLayout, angularSizeDp, background, curvedBox, curvedComposable, curvedRowCurvedTextSamples, CurvedWorldSample
CurvedModifierCurvedTextSamples, CurvedWorldSample, TimeTextSample
HorizontalPager, VerticalPager, rememberPagerStateOneHandedGestureSamples, PageIndicatorSample, PagerSamples, PagerScaffoldSample
PagerDefaultsPagerScaffoldSample
RotaryScrollableDefaultsPagerScaffoldSample, RotarySamples, TransformingLazyColumnSample
RotarySnapLayoutInfoProvider, rotaryScrollableRotarySamples
ScrollInfoProviderScrollAwaySample
SwipeToDismissValue, edgeSwipeToDismiss, rememberSwipeToDismissBoxStateSwipeToDismissBoxSample, SwipeToDismissBoxSample
TransformingLazyColumnDynamicColorSchemeSample, ListHeaderSample, OneHandedGestureSamples, ScaffoldSample, ScrollAwaySample, ScrollIndicatorSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformationSpecSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample, TransformingLazyColumnSample
TransformingLazyColumnDefaultsTransformingLazyColumnSample
TransformingLazyColumnFirstLayoutItemProviderTransformingLazyColumnSample, TransformingLazyColumnSample
TransformingLazyColumnItemScrollProgressTransformationSpecSample
expandableButton, expandableItem, expandableItems, rememberExpandableStateExpandableSample
hierarchicalFocusGroupHierarchicalFocusSample
itemsSwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformingLazyColumnNotificationsSample
itemsIndexedTransformingLazyColumnSample
rememberTransformingLazyColumnStateListHeaderSample, OneHandedGestureSamples, ScaffoldSample, ScrollAwaySample, ScrollIndicatorSample, SurfaceTransformationSample, SwipeDismissableSceneStrategySample, SwipeToRevealSample, TransformingLazyColumnNotificationsSample, TransformingLazyColumnSample, TransformingLazyColumnSample
requestFocusOnHierarchyActiveHierarchicalFocusSample, RotarySamples
weightCurvedWorldSample, TimeTextSample
Navigation 3 components in androidx.wear.compose.navigation3.*
Component / SymbolReference Samples
rememberSwipeDismissableSceneStrategySwipeDismissableSceneStrategySample
Capability 3: Component guidance

Mandatory: Use this capability as a checklist against any component use. It provides more holistic guidance on how to use each component in practice, beyond the component syntax.

  1. AppScaffold and ScreenScaffold

    • [ ] Use AppScaffold as the outer container, with ScreenScaffold children.

    • [ ] Use only ONE AppScaffold and any number of ScreenScaffold.

  2. ScalingLazyColumn - Use TransformingLazyColumn instead.

  3. TransformingLazyColumn - You will need the following imports:

    import androidx.wear.compose.foundation.lazy.TransformingLazyColumn
    import androidx.wear.compose.foundation.lazy.TransformingLazyColumnDefaults
    import androidx.wear.compose.foundation.lazy.rememberTransformingLazyColumnState
    // ...
    import androidx.wear.compose.material3.lazy.rememberTransformationSpec
    import androidx.wear.compose.material3.lazy.transformedHeight

    <br />

    Canonical example:

    val columnState = rememberTransformingLazyColumnState()
    val transformationSpec = rememberTransformationSpec()
    ScreenScaffold(
        scrollState = columnState
    ) { contentPadding ->
        TransformingLazyColumn(
            state = columnState,
            contentPadding = contentPadding
        ) {
            item {
                ListHeader(
                    modifier = Modifier
                        .fillMaxWidth()
                        .transformedHeight(this, transformationSpec)
                        .minimumVerticalContentPadding(ListHeaderDefaults.minimumTopListContentPadding),
                    transformation = SurfaceTransformation(transformationSpec)
                ) {
                    Text(text = "Header")
                }
            }
            // ... other items
            item {
                Button(
                    modifier = Modifier
                        .fillMaxWidth()
                        .transformedHeight(this, transformationSpec)
                        .minimumVerticalContentPadding(ButtonDefaults.minimumVerticalListContentPadding),
                    transformation = SurfaceTransformation(transformationSpec),
                    onClick = { /* ... */ },
                    icon = {
                        Icon(
                            imageVector = Icons.Default.Build,
                            contentDescription = "build",
                        )
                    },
                ) {
                    Text(
                        text = "Build",
                        maxLines = 1,
                        overflow = TextOverflow.Ellipsis,
                    )
                }
            }
        }
    }

    <br />

    • [ ] Use TransformingLazyColumn instead of ScalingLazyColumn.

    • [ ] You must pass the contentPadding parameter from ScreenScaffold to the TransformingLazyColumn.

    • [ ] Use the minimumVerticalContentPadding modifier to achieve required padding top and bottom.

      • This expects a value from defaults, such as ButtonDefaults, CardDefaults, ListHeaderDefaults.

      • Note: This is a scoped modifier available within TransformingLazyColumnItemScope.

    • [ ] Ensure items morph and scale (apply to components within TransformingLazyColumn, not the list itself):

      • [ ] Use Modifier.transformedHeight(this, transformationSpec).

      • [ ] Use transformation = SurfaceTransformation(transformationSpec).

    • [ ] If configuring a list for snapping, use flingBehavior and rotaryScrollableBehavior together:

    val columnState = rememberTransformingLazyColumnState()
    ScreenScaffold(scrollState = columnState) { contentPadding ->
        TransformingLazyColumn(
            state = columnState,
            flingBehavior = TransformingLazyColumnDefaults.snapFlingBehavior(columnState),
            rotaryScrollableBehavior = RotaryScrollableDefaults.snapBehavior(columnState)
        ) {
            // ...
            // ...
        }
    }

    <br />

  4. ScreenScaffold

    • [ ] Guard the scrollIndicator with !LocalScrollCaptureInProgress.current (androidx.compose.ui.platform).

  5. EdgeButton

    • [ ] Do NOT use as the final item within a TransformingLazyColumn. Instead, use the slot in ScreenScaffold.

    • [ ] When used in a TransformingLazyColumn, add the required overscroll behavior:

    val columnState = rememberTransformingLazyColumnState()
    ScreenScaffold(
        scrollState = columnState,
        edgeButton = {
            EdgeButton(
                onClick = { /* TODO */ },
                modifier = Modifier.scrollable(
                    columnState,
                    orientation = Orientation.Vertical,
                    reverseDirection = true,
                    // Apply overscroll to the EdgeButton for proper scrolling behavior.
                    overscrollEffect = rememberOverscrollEffect(),
                )
            ) {
                Text("More")
            }
        }
    ) { contentPadding ->
        TransformingLazyColumn(
            contentPadding = contentPadding,
            state = columnState,
        ) {
            // ...
            // ...
        }
    }

    <br />

  6. Column

    • [ ] USE as a direct child of ScreenScaffold if the screen will never scroll, even with the largest system font.

    • [ ] Use TransformingLazyColumn instead for all other cases.

  7. Styles

    • [ ] Do NOT hard-code text sizes, use typography from MaterialTheme.

    • [ ] Do NOT hard-code colors, use colorScheme from MaterialTheme.

  8. Use component defaults:

    • [ ] Components such as Button have a corresponding ButtonDefaults object.

    • [ ] Check for and use the *Defaults object for any component when working with padding and styling values, in preference to hard-coded values.

  9. Use Wear-specific preview annotations (androidx.wear.compose.ui.tooling.preview):

    • [ ] @WearPreviewDevices

    • [ ] @WearPreviewFontScales

    • [ ] Ensure the androidx.wear.compose:compose-ui-tooling dependency is included.

  10. Ambient mode

    • [ ] Use LocalAmbientModeManager (provided by CompositionLocalProvider and rememberAmbientModeManager()) instead of AmbientLifecycleObserver.

  11. Navigation

    • [ ] When adding navigation fresh, use Navigation3 (androidx.wear.compose:compose-navigation3).

    • [ ] Use rememberSwipeDismissableSceneStrategy() / SwipeDismissableSceneStrategy (androidx.wear.compose.navigation3).

  12. Comments

    • [ ] Where any Kotlin file has been modified, ensure that the existing comments are up to date and accurately reflect any changes to the implementation.

  13. HorizontalPager or VerticalPager

    • [ ] Use the Composable hierarchy in this order: AppScaffold, HorizontalPagerScaffold, HorizontalPager, AnimatedPage, ScreenScaffold. Or similarly for VerticalPager.

Files

references/material3/PickerSample.kt.md

/*
 * Copyright 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.wear.compose.material3.samples

import androidx.annotation.Sampled
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.scrollable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material3.Button
import androidx.wear.compose.material3.Picker
import androidx.wear.compose.material3.Text
import androidx.wear.compose.material3.rememberPickerState
import kotlinx.coroutines.launch

@Sampled
@Composable
fun SimplePicker() {
    val items = listOf("One", "Two", "Three", "Four", "Five")
    val state = rememberPickerState(items.size)
    // We forward scroll gestures from the whole screen to the Picker which makes this sample
    // accessible for 2-finger vertical scrolling.
    Box(
        modifier =
            Modifier.fillMaxSize()
                .scrollable(
                    state = state,
                    orientation = Orientation.Vertical,
                    reverseDirection = true,
                ),
        contentAlignment = Alignment.Center,
    ) {
        val selectedLabel by remember {
            derivedStateOf { "Selected: ${items[state.selectedOptionIndex]}" }
        }
        Text(
            modifier = Modifier.align(Alignment.TopCenter).padding(top = 10.dp),
            text = selectedLabel,
        )
        Picker(
            modifier = Modifier.size(100.dp, 100.dp),
            state = state,
            contentDescription = { "${state.selectedOptionIndex + 1}" },
        ) {
            Text(items[it])
        }
    }
}

@Sampled
@Composable
fun PickerScrollToOption() {
    val coroutineScope = rememberCoroutineScope()
    val state = rememberPickerState(initialNumberOfOptions = 10)
    Picker(
        state = state,
        verticalSpacing = 4.dp,
        contentDescription = { "${state.selectedOptionIndex + 1}" },
    ) {
        Button(
            onClick = { coroutineScope.launch { state.scrollToOption(it) } },
            label = { Text("$it") },
        )
    }
}

@Sampled
@Composable
fun PickerAnimateScrollToOption() {
    val coroutineScope = rememberCoroutineScope()
    val state = rememberPickerState(initialNumberOfOptions = 10)

    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Picker(
            state = state,
            verticalSpacing = 4.dp,
            contentDescription = { "${state.selectedOptionIndex + 1}" },
        ) {
            Button(
                onClick = { coroutineScope.launch { state.animateScrollToOption(it) } },
                label = { Text("$it") },
            )
        }
    }
}

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs network access

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Google LLC
Publisher
Android (Google) (Official)
Distributed by
Android (Google)
Source
android/skills · wear/wear-compose-m3 · commit bf68e2d
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.txt)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google LLC or Android (Google).

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download wear-compose-m3.zip