Wear Compose M3
Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)
- Skill
- Tool integration
- Software development
- Apache-2.0
- No issues found
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
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/android/wear-compose-m3/downloadUnzip 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
Current Wear OS Compose version in-use: To find the installed library version, read
gradle/libs.versions.tomlorbuild.gradle.ktsdirectly. Don't run./gradlew dependenciesor other shell commands to resolve versions.Wear OS Compose Material3 version: If an internal tool is available to establish the latest stable version
{VERSION}ofandroidx.wear.compose:compose-material3, use that tool.Otherwise, fetch the official Maven metadata XML to identify
{VERSION}(highest number, ignoring-alpha,-beta, or-rc).
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.
Kotlin & Compose compiler: Use Kotlin 2.0.0+ with the
org.jetbrains.kotlin.plugin.composeGradle plugin.Min SDK: Ensure
minSdkis at least 25.Compile SDK & AGP: Ensure
compileSdkand AGP meet the library's AAR metadata floors (compileSdk >= 35andAGP >= 8.6.0for1.6.x;compileSdk >= 37andAGP >= 9.1.0for1.7.x).
Gotchas
Mandatory sync and validation: After updating versions in
libs.versions.tomlorbuild.gradle.kts, perform a Gradle sync (or./gradlew assembleDebug) before refactoring, and run./gradlew assembleDebugafter refactoring to verify the build.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.
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).When migrating from Material 2.5 or Horologist, read the migration guide and use its official component mappings.
Before refactoring any component (for example,
Chip->Button), check the parameter names, slot types, and "Expressive" design tokens.Do not use the Horologist Composables, Compose Layout, or Compose Material libraries; replace Horologist components with Wear Compose M3 equivalents (
AppScaffold-> M3AppScaffold,ScreenScaffold-> M3ScreenScaffold,ScalingLazyColumn->TransformingLazyColumn,ResponsiveListHeader->ListHeader,PagerScreen->HorizontalPagerScaffold,Chip->Button,Confirmation->ConfirmationDialog).Always check against the component guidance in Capability 3.
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.*
Foundation components in androidx.wear.compose.foundation.*
Navigation 3 components in androidx.wear.compose.navigation3.*
| Component / Symbol | Reference Samples |
|---|---|
rememberSwipeDismissableSceneStrategy | SwipeDismissableSceneStrategySample |
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.
AppScaffoldandScreenScaffold[ ] Use
AppScaffoldas the outer container, withScreenScaffoldchildren.[ ] Use only ONE
AppScaffoldand any number ofScreenScaffold.
ScalingLazyColumn- UseTransformingLazyColumninstead.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
TransformingLazyColumninstead ofScalingLazyColumn.[ ] You must pass the
contentPaddingparameter fromScreenScaffoldto theTransformingLazyColumn.[ ] Use the
minimumVerticalContentPaddingmodifier 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
flingBehaviorandrotaryScrollableBehaviortogether:
val columnState = rememberTransformingLazyColumnState() ScreenScaffold(scrollState = columnState) { contentPadding -> TransformingLazyColumn( state = columnState, flingBehavior = TransformingLazyColumnDefaults.snapFlingBehavior(columnState), rotaryScrollableBehavior = RotaryScrollableDefaults.snapBehavior(columnState) ) { // ... // ... } }<br />
ScreenScaffold[ ] Guard the
scrollIndicatorwith!LocalScrollCaptureInProgress.current(androidx.compose.ui.platform).
EdgeButton[ ] Do NOT use as the final item within a
TransformingLazyColumn. Instead, use the slot inScreenScaffold.[ ] 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 />
Column[ ] USE as a direct child of
ScreenScaffoldif the screen will never scroll, even with the largest system font.[ ] Use
TransformingLazyColumninstead for all other cases.
Styles
[ ] Do NOT hard-code text sizes, use
typographyfromMaterialTheme.[ ] Do NOT hard-code colors, use
colorSchemefromMaterialTheme.
Use component defaults:
[ ] Components such as
Buttonhave a correspondingButtonDefaultsobject.[ ] Check for and use the
*Defaultsobject for any component when working with padding and styling values, in preference to hard-coded values.
Use Wear-specific preview annotations (
androidx.wear.compose.ui.tooling.preview):[ ]
@WearPreviewDevices[ ]
@WearPreviewFontScales[ ] Ensure the
androidx.wear.compose:compose-ui-toolingdependency is included.
Ambient mode
[ ] Use
LocalAmbientModeManager(provided byCompositionLocalProviderandrememberAmbientModeManager()) instead ofAmbientLifecycleObserver.
Navigation
[ ] When adding navigation fresh, use Navigation3 (
androidx.wear.compose:compose-navigation3).[ ] Use
rememberSwipeDismissableSceneStrategy()/SwipeDismissableSceneStrategy(androidx.wear.compose.navigation3).
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.
HorizontalPagerorVerticalPager[ ] Use the Composable hierarchy in this order:
AppScaffold,HorizontalPagerScaffold,HorizontalPager,AnimatedPage,ScreenScaffold. Or similarly forVerticalPager.
Files
- ATTRIBUTION.mdAdded by AutoGineer952 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md38.2 KiB
- references/android/training/wearables/compose/migrate-to-material3.md89.1 KiB
- references/foundation/AmbientModeSample.kt.md5.0 KiB
- references/foundation/CurvedWorldSample.kt.md14.3 KiB
- references/foundation/ExpandableSample.kt.md3.6 KiB
- references/foundation/HierarchicalFocusSample.kt.md5.4 KiB
- references/foundation/PagerSamples.kt.md2.0 KiB
- references/foundation/RotarySamples.kt.md6.0 KiB
- references/foundation/SwipeToDismissBoxSample.kt.md7.3 KiB
- references/foundation/TransformingLazyColumnSample.kt.md12.9 KiB
- references/material3/AlertDialogSample.kt.md15.1 KiB
- references/material3/AnimatedTextSample.kt.md6.2 KiB
- references/material3/ButtonGroupSample.kt.md3.3 KiB
- references/material3/ButtonSample.kt.md17.0 KiB
- references/material3/CardSample.kt.md15.2 KiB
- references/material3/CheckboxButtonSample.kt.md2.3 KiB
- references/material3/ConfirmationDialogSample.kt.md5.4 KiB
- references/material3/CurvedTextSamples.kt.md2.9 KiB
- references/material3/DatePickerSample.kt.md4.7 KiB
- references/material3/DynamicColorSchemeSample.kt.md3.0 KiB
- references/material3/EdgeButtonSample.kt.md2.3 KiB
- references/material3/FadingExpandingLabelSample.kt.md2.1 KiB
- references/material3/IconButtonSample.kt.md3.9 KiB
- references/material3/IconToggleButtonSample.kt.md3.6 KiB
- references/material3/LevelIndicatorSample.kt.md2.5 KiB
- references/material3/LinearProgressIndicatorSample.kt.md1.8 KiB
- references/material3/ListHeaderSample.kt.md7.6 KiB
- references/material3/OneHandedGestureSamples.kt.md31.5 KiB
- references/material3/OpenOnPhoneDialogSample.kt.md2.0 KiB
- references/material3/PageIndicatorSample.kt.md4.1 KiB
- references/material3/PagerScaffoldSample.kt.md8.5 KiB
- references/material3/PickerGroupSample.kt.md5.8 KiB
- references/material3/PickerSample.kt.md3.6 KiB
- references/material3/PlaceholderSample.kt.md6.5 KiB
- references/material3/ProgressIndicatorSample.kt.md8.8 KiB
- references/material3/RadioButtonSample.kt.md4.2 KiB
- references/material3/ScaffoldSample.kt.md6.2 KiB
- references/material3/ScrollAwaySample.kt.md3.7 KiB
- references/material3/ScrollIndicatorSample.kt.md2.4 KiB
- references/material3/SliderSample.kt.md2.4 KiB
- references/material3/StepperSample.kt.md5.2 KiB
- references/material3/SurfaceTransformationSample.kt.md6.0 KiB
- references/material3/SwipeToDismissBoxSample.kt.md7.3 KiB
- references/material3/SwipeToRevealSample.kt.md13.7 KiB
- references/material3/SwitchButtonSample.kt.md2.3 KiB
- references/material3/TextButtonSample.kt.md3.0 KiB
- references/material3/TextToggleButtonSample.kt.md2.3 KiB
- references/material3/TimePickerSample.kt.md5.5 KiB
- references/material3/TimeTextSample.kt.md2.5 KiB
- references/material3/TransformationSpecSample.kt.md9.9 KiB
- references/material3/TransformingLazyColumnNotificationsSample.kt.md3.7 KiB
- references/material3/TransformingLazyColumnSample.kt.md13.0 KiB
- references/navigation3/SwipeDismissableSceneStrategySample.kt.md8.3 KiB
references/material3/TimePickerSample.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.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Edit
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.wear.compose.material3.Button
import androidx.wear.compose.material3.Icon
import androidx.wear.compose.material3.Text
import androidx.wear.compose.material3.TimePicker
import androidx.wear.compose.material3.TimePickerType
import java.time.LocalTime
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
@Sampled
@Composable
fun TimePickerSample() {
var showTimePicker by remember { mutableStateOf(true) }
var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
if (showTimePicker) {
TimePicker(
onTimePicked = {
timePickerTime = it
showTimePicker = false
},
initialTime = timePickerTime, // Initialize with last picked time on reopen
)
} else {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
val formatter =
DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT)
.withLocale(LocalConfiguration.current.locales[0])
Button(
onClick = { showTimePicker = true },
label = { Text("Selected Time") },
secondaryLabel = { Text(timePickerTime.format(formatter)) },
icon = { Icon(imageVector = Icons.Filled.Edit, contentDescription = "Edit") },
)
}
}
}
@Sampled
@Composable
fun TimePickerWithMinutesAndSecondsSample() {
var showTimePicker by remember { mutableStateOf(true) }
var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
if (showTimePicker) {
TimePicker(
onTimePicked = {
timePickerTime = it
showTimePicker = false
},
timePickerType = TimePickerType.MinutesSeconds,
initialTime = timePickerTime, // Initialize with last picked time on reopen
)
} else {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
val formatter = DateTimeFormatter.ofPattern("mm:ss")
Button(
onClick = { showTimePicker = true },
label = { Text("Selected Time") },
secondaryLabel = { Text(timePickerTime.format(formatter)) },
icon = { Icon(imageVector = Icons.Filled.Edit, contentDescription = "Edit") },
)
}
}
}
@Sampled
@Composable
fun TimePickerWithSecondsSample() {
var showTimePicker by remember { mutableStateOf(true) }
var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
if (showTimePicker) {
TimePicker(
onTimePicked = {
timePickerTime = it
showTimePicker = false
},
timePickerType = TimePickerType.HoursMinutesSeconds24H,
initialTime = timePickerTime, // Initialize with last picked time on reopen
)
} else {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
val formatter = DateTimeFormatter.ofPattern("HH:mm:ss")
Button(
onClick = { showTimePicker = true },
label = { Text("Selected Time") },
secondaryLabel = { Text(timePickerTime.format(formatter)) },
icon = { Icon(imageVector = Icons.Filled.Edit, contentDescription = "Edit") },
)
}
}
}
@Sampled
@Composable
fun TimePickerWith12HourClockSample() {
var showTimePicker by remember { mutableStateOf(true) }
var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
if (showTimePicker) {
TimePicker(
onTimePicked = {
timePickerTime = it
showTimePicker = false
},
timePickerType = TimePickerType.HoursMinutesAmPm12H,
initialTime = timePickerTime, // Initialize with last picked time on reopen
)
} else {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
val formatter = DateTimeFormatter.ofPattern("hh:mm a")
Button(
onClick = { showTimePicker = true },
label = { Text("Selected Time") },
secondaryLabel = { Text(timePickerTime.format(formatter)) },
icon = { Icon(imageVector = Icons.Filled.Edit, contentDescription = "Edit") },
)
}
}
}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