Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Design Android app UI/UX following Material Design 3 guidelines with Jetpack Compose layout patterns.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: mobile-android-design3description: Master Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.4---56# Android Mobile Design78Master Material Design 3 (Material You) and Jetpack Compose to build modern, adaptive Android applications that integrate seamlessly with the Android ecosystem.910## When to Use This Skill1112- Designing Android app interfaces following Material Design 313- Building Jetpack Compose UI and layouts14- Implementing Android navigation patterns (Navigation Compose)15- Creating adaptive layouts for phones, tablets, and foldables16- Using Material 3 theming with dynamic colors17- Building accessible Android interfaces18- Implementing Android-specific gestures and interactions19- Designing for different screen configurations2021## Detailed section: Core Concepts2223Originally a 9201-byte section in this SKILL.md. Moved to `references/details.md` to fit Codex's 8 KB skill body cap.2425## Quick Start Component2627```kotlin28@Composable29fun ItemListCard(30item: Item,31onItemClick: () -> Unit,32modifier: Modifier = Modifier33) {34Card(35onClick = onItemClick,36modifier = modifier.fillMaxWidth(),37shape = RoundedCornerShape(12.dp)38) {39Row(40modifier = Modifier41.padding(16.dp)42.fillMaxWidth(),43verticalAlignment = Alignment.CenterVertically44) {45Box(46modifier = Modifier47.size(48.dp)48.clip(CircleShape)49.background(MaterialTheme.colorScheme.primaryContainer),50contentAlignment = Alignment.Center51) {52Icon(53imageVector = Icons.Default.Star,54contentDescription = null,55tint = MaterialTheme.colorScheme.onPrimaryContainer56)57}5859Spacer(modifier = Modifier.width(16.dp))6061Column(modifier = Modifier.weight(1f)) {62Text(63text = item.title,64style = MaterialTheme.typography.titleMedium65)66Text(67text = item.subtitle,68style = MaterialTheme.typography.bodyMedium,69color = MaterialTheme.colorScheme.onSurfaceVariant70)71}7273Icon(74imageVector = Icons.Default.ChevronRight,75contentDescription = null,76tint = MaterialTheme.colorScheme.onSurfaceVariant77)78}79}80}81```8283## Best Practices84851. **Use Material Theme**: Access colors via `MaterialTheme.colorScheme` for automatic dark mode support862. **Support Dynamic Color**: Enable dynamic color on Android 12+ for personalization873. **Adaptive Layouts**: Use `WindowSizeClass` for responsive designs884. **Content Descriptions**: Add `contentDescription` to all interactive elements895. **Touch Targets**: Minimum 48dp touch targets for accessibility906. **State Hoisting**: Hoist state to make components reusable and testable917. **Remember Properly**: Use `remember` and `rememberSaveable` appropriately928. **Preview Annotations**: Add `@Preview` with different configurations9394## Common Issues9596- **Recomposition Issues**: Avoid passing unstable lambdas; use `remember`97- **State Loss**: Use `rememberSaveable` for configuration changes98- **Performance**: Use `LazyColumn` instead of `Column` for long lists99- **Theme Leaks**: Ensure `MaterialTheme` wraps all composables100- **Navigation Crashes**: Handle back press and deep links properly101- **Memory Leaks**: Cancel coroutines in `DisposableEffect`102