/android-skills:android-uxfrom android-skills
Applies Material Design 3 UX principles for Android UI design and review. Covers touch targets, spacing, navigation patterns, accessibility, animation timing, foldable postures, and M3 contrast levels. Includes a 10-category compliance audit.
Ships in android-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This reference covers the non-obvious platform facts and reviewing an existing screen for M3 compliance, not the basics of building M3-correct UI.
Foldables introduce postures beyond window size classes. Detect them with WindowInfoTracker + FoldingFeature (Jetpack WindowManager), and never place interactive content or critical information across the hinge.
| Posture | Detection | Layout behavior |
|---|---|---|
| Flat (unfolded) | no folding feature | Treat as Medium/Expanded by width |
| Half-opened, horizontal fold (tabletop) | HALF_OPENED + Orientation.HORIZONTAL | Content above the hinge, controls below it — read the hinge bounds, never assume a 50/50 split |
| Half-opened, vertical fold (book) | HALF_OPENED + Orientation.VERTICAL | List left, detail right |
| Folded (cover screen) | — | Treat as Compact |
On current Compose, the adaptive APIs replace the manual tracker: mediaQuery { windowPosture == UiMediaScope.Posture.Tabletop } — see Google's adaptive skill (android skills add adaptive). The WindowInfoTracker form below works on older versions.
@Composable
fun FoldAwareLayout() {
val context = LocalContext.current
val layoutInfo by WindowInfoTracker.getOrCreate(context)
.windowLayoutInfo(context) // accepts @UiContext — Activity, InputMethodService, or createWindowContext()
.collectAsStateWithLifecycle(initialValue = WindowLayoutInfo(emptyList()))
val fold = layoutInfo.displayFeatures.filterIsInstance<FoldingFeature>().firstOrNull()
when {
fold?.state == FoldingFeature.State.HALF_OPENED ->
if (fold.orientation == FoldingFeature.Orientation.HORIZONTAL) TabletopLayout() else BookLayout()
else -> StandardAdaptiveLayout() // by window size class
}
}
Compose's dynamicLightColorScheme / dynamicDarkColorScheme read the system contrast setting automatically (SDK 34+) and expose no contrast parameter. To offer in-app contrast control (Standard 0.0 / Medium 0.5 / High 1.0 tonal distance), build the scheme from Hct + SchemeContent:
// com.google.android.material:material (MDC-Android), package com.google.android.material.color.utilities
// Marked @RestrictTo(LIBRARY_GROUP) — internal API, may change between versions; re-check on version bumps.
val hct = Hct.fromInt(0xFF6750A4.toInt())
val scheme = SchemeContent(hct, /* isDark = */ false, /* contrastLevel = */ 1.0)
val colorScheme = lightColorScheme(
primary = Color(scheme.primary),
onPrimary = Color(scheme.onPrimary),
// ... map remaining roles
)
For multiplatform or a stable public API, com.materialkolor:material-color-utilities is a KMP alternative.
Use M3's duration ladder rather than arbitrary millis, and pick easing by what the element does — decelerate to enter, accelerate to exit, emphasized to move on screen (values in compose/references/animation.md). Reach for MotionScheme (Compose M3 1.4+) where available; otherwise hold durations at one source of truth in the theme.
| Token group | Range | Typical use |
|---|---|---|
short1…short4 | 50–200ms | Micro-interactions, state changes (ripple, selection, switch) |
medium1…medium4 | 250–400ms | Standard transitions (screen enter/exit, expansion, reveal) |
long1…long4 | 450–600ms | Container transforms, fade-through between large surfaces |
extraLong1…extraLong4 | 700–1000ms | Shared-element / hero transitions on tablets/foldables |
Animations must be interruptible and never block input. Reduced motion: Compose already applies the system animator duration scale to its animations (through MotionDurationScale), so with animations off they finish instantly — no code needed for that. Add the local below only to swap the motion design, e.g. drop a slide and keep nothing; Compose has no built-in LocalReducedMotion:
val LocalReducedMotion = staticCompositionLocalOf { false }
@Composable
fun AppTheme(content: @Composable () -> Unit) {
val context = LocalContext.current
val reduceMotion = remember {
Settings.Global.getFloat(context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f) == 0f
}
CompositionLocalProvider(LocalReducedMotion provides reduceMotion) { MaterialTheme { content() } }
}
// at the call site
AnimatedVisibility(
visible = isVisible,
enter = if (LocalReducedMotion.current) EnterTransition.None else fadeIn() + slideInVertically(),
) { Content() }
(staticCompositionLocalOf + keyless remember read the setting once per Activity; for live updates switch to compositionLocalOf + a ContentObserver on ANIMATOR_DURATION_SCALE.)
Use this when reviewing a screen or feature for Material Design 3 compliance — the part that's easy to skip from memory. Score each category Pass / Partial / Fail, then fix any Partial/Fail before shipping.
MaterialTheme.colorScheme roles — no hardcoded hex/ARGB.primary for key actions, secondary/tertiary for less prominent / accents, error for errors; on* paired correctly; layered surfaces via surfaceContainerLow/High, not arbitrary grays.outline for interactive boundaries needing 3:1 (field borders, focus rings), outlineVariant for decorative dividers.MaterialTheme.typography — no inline fontSize/fontWeight.display* hero, headline* section headers, title* card/dialog titles, body* content, label* buttons/captions.MaterialTheme.shapes, not hardcoded RoundedCornerShape.extraSmall (4dp) chips, small (8dp) cards, medium (12dp) dialogs, large (16dp) sheets, extraLarge (28dp) FABs. Consistent shape language.ElevatedCard/ElevatedButton over manual shadowElevation.surfaceContainerLowest < … < Highest) — if two adjacent layers render the same color in either theme, the elevation cue is broken.androidx.compose.material3.*), no M2 (androidx.compose.material.*) and no M2/M3 mixing on a screen.FloatingActionButton for the primary action, Card for grouped content, TopAppBar for screen-level actions.Run from the project root — each hit is a category-1/3/5 violation to triage before human review:
rg --type kt 'Color\(0x[0-9a-fA-F]{6,8}\)' --files-with-matches | head # 1: hardcoded colors
rg --type kt 'RoundedCornerShape\(\s*\d+(?:\.\d+)?\s*\.dp\s*\)' --files-with-matches | head # 3: hardcoded radii
rg --type kt 'import androidx\.compose\.material\.' --files-with-matches | head # 5: Material 2 imports
selected + active indicator.Emphasized at 300–500ms; enter/exit follow M3 (fade-through, container transform); interruptible and respect reduced motion.contentDescription; contrast meets WCAG AA (4.5:1 body, 3:1 large text + UI components); touch targets ≥48dp.semantics(mergeDescendants = true) so TalkBack announces them as one unit (icon contentDescription = null when merged).semantics { heading() } so screen-reader users can jump between sections.semantics { traversalIndex } where needed). User-controlled contrast (Standard/Medium/High) considered if supported.MaterialTheme (no nested/conflicting themes); light + dark both tested; custom theme extensions via CompositionLocal, not globals; brand colors via a custom ColorScheme, not per-component overrides.Screen: [name] Date: [date]
| # | Category | Score | Notes |
|---|---------------------|---------|------------------------|
| 1 | Color tokens | Pass | |
| 2 | Typography | Partial | bodySmall hardcoded |
| 5 | Components | Fail | M2 Scaffold still used |
| 6 | Layout & spacing | Partial | No tablet breakpoint |
| 9 | Accessibility | Partial | Missing headings |
…
Action items:
- [ ] ...
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
material-design-3, android-ui, ux-review, foldables, accessibility
npx claudepluginhub rcosteira79/android-skills --plugin android-skills21 skills in this plugin
/android-data-layerUse when implementing the data layer in Android or KMP — the Repository pattern's layered error-propagation model (repository as the error boundary, sealed DataError, Result placement with and without a domain layer) and Room in commonMain (@ConstructedBy, BundledSQLiteDriver, per-target KSP)./android-debuggingUse when debugging Android or KMP issues — crashes, ANRs, performance regressions, obfuscated release stack traces, wrong on-screen UI state, or a bad value crossing several layers.
/android-devUse this skill as the baseline for ALL Android and Kotlin Multiplatform (KMP) work — whenever the user mentions Android, Kotlin (in an Android context), KMP, CMP, commonMain, androidMain, iosMain, AndroidManifest, Gradle, build.gradle, Hilt, Dagger, Room, Retrofit, Ktor, ViewModel, LiveData, StateFlow, SharedFlow, Compose, Activity, Fragment, Intent, ADB, Logcat, MVVM, MVI, repository pattern, or any Android SDK / Jetpack / AndroidX API. Always load this skill alongside the more specific skills (android-skills:compose, android-skills:kotlin-flows, android-skills:kmp-ktor, android-skills:android-retrofit, etc.): it routes to them and adds the few baseline rules that are easy to get wrong. Casual mentions like "fix this bug in my Android app," "refactor this ViewModel," "my KMP project," or any work inside an Android project directory should trigger this skill.
/android-gradle-logicUse when setting up or refactoring Android Gradle build logic — convention plugins, composite builds, version catalogs, and shared build configuration across modules./android-retrofitUse when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in the repository layer./android-source-searchUse when needing to fetch Android source code — AOSP platform internals (@hide APIs, framework classes, system services) or AndroidX/Jetpack library source and samples. Also use when public docs are insufficient to complete a task and implementation details must be read directly from source.Other plugins' skills for the same job