mobile-android-design
它能做什么
这个技能可以帮你设计 Android 应用的外观和交互感受,采用 Google 最新的设计规范(Material Design 3),并使用现代的编程方式 Jetpack Compose 来开发。它能确保你的应用在不同尺寸的屏幕上都好看、好用。
适用场景
- ✓当你要设计 Android 应用的外观时。
- ✓当你要用 Jetpack Compose 构建应用页面和按钮时。
- ✓当你希望应用能适配手机、平板和折叠屏时。
技能链接
https://github.com/wshobson/agents/blob/main/plugins/ui-design/skills/mobile-android-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想按照 Material Design 3 的规范,做一个用户点击时会变色的按钮,该怎么做?”
每周 5 个新技能,1 分钟读完。
工作原理
它会依据 Material Design 3 规范和 Jetpack Compose,定义按钮、文字和布局的外观。这包括颜色、形状,以及它们在屏幕上的排列方式,确保在各种设备上都能正常显示。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Android Mobile Design
Master Material Design 3 (Material You) and Jetpack Compose to build modern, adaptive Android applications that integrate seamlessly with the Android ecosystem.
When to Use This Skill
- Designing Android app interfaces following Material Design 3
- Building Jetpack Compose UI and layouts
- Implementing Android navigation patterns (Navigation Compose)
- Creating adaptive layouts for phones, tablets, and foldables
- Using Material 3 theming with dynamic colors
- Building accessible Android interfaces
- Implementing Android-specific gestures and interactions
- Designing for different screen configurations
Detailed section: Core Concepts
Originally a 9201-byte section in this SKILL.md. Moved to references/details.md to fit Codex's 8 KB skill body cap.
Quick Start Component
@Composable
fun ItemListCard(
item: Item,
onItemClick: () -> Unit,
modifier: Modifier = Modifier
) {
Card(
onClick = onItemClick,
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(12.dp)
) {
Row(
modifier = Modifier
.padding(16.dp)
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Box(
modifier = Modifier
.size(48.dp)
.clip(CircleShape)
.background(MaterialTheme.colorScheme.primaryContainer),
contentAlignment = Alignment.Center
) {
Icon(
imageVector = Icons.Default.Star,
contentDescription = null,
tint = MaterialTheme.colorScheme.onPrimaryContainer
)
}
Spacer(modifier = Modifier.width(16.dp))
Column(modifier = Modifier.weight(1f)) {
Text(
text = item.title,
style = MaterialTheme.typography.titleMedium
)
Text(
text = item.subtitle,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
Icon(
imageVector = Icons.Default.ChevronRight,
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
}
Best Practices
- Use Material Theme: Access colors via
MaterialTheme.colorSchemefor automatic dark mode support - Support Dynamic Color: Enable dynamic color on Android 12+ for personalization
- Adaptive Layouts: Use
WindowSizeClassfor responsive designs - Content Descriptions: Add
contentDescriptionto all interactive elements - Touch Targets: Minimum 48dp touch targets for accessibility
- State Hoisting: Hoist state to make components reusable and testable
- Remember Properly: Use
rememberandrememberSaveableappropriately - Preview Annotations: Add
@Previewwith different configurations
Common Issues
- Recomposition Issues: Avoid passing unstable lambdas; use
remember - State Loss: Use
rememberSaveablefor configuration changes - Performance: Use
LazyColumninstead ofColumnfor long lists - Theme Leaks: Ensure
MaterialThemewraps all composables - Navigation Crashes: Handle back press and deep links properly
- Memory Leaks: Cancel coroutines in
DisposableEffect
常见问题
什么是 Material Design 3?
它是 Google 提供的一套规则和工具,用于在 Android 设备上打造美观、统一且易用的应用界面。
什么是 Jetpack Compose?
它是一种更现代、更简洁的 Android 界面开发方式,直接用代码描述界面,不必再把视觉设计单独放在另外的文件里。
应用如何适配不同屏幕?
通过“自适应布局”和 WindowSizeClass 等技术,调整元素的大小和位置,让它们在小屏和大屏上都显示良好。
详情
作者的原始描述
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.
repo: wshobson/agents
热度
- GitHub 星标
- 41k
- 排名
- #6804
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …