원클릭으로
jetpack-compose
Jetpack Compose patterns for declarative UI, state management, theming, animations, and performance optimization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Jetpack Compose patterns for declarative UI, state management, theming, animations, and performance optimization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Core Android development patterns for Kotlin, including coroutines, lifecycle management, and functional programming idioms.
Apple Combine framework for reactive programming. Publishers, subscribers, operators, and error handling.
Pattern extraction and skill generation for mobile development sessions. Automatically learns from your coding patterns.
Instinct-based learning system with confidence scoring for mobile patterns. Automatically extracts and evolves patterns.
Core Data for iOS persistence. Data models, fetch requests, background contexts, and SwiftData migration.
Kotlin Coroutines and Flow patterns for structured concurrency, error handling, and async operations.
| name | jetpack-compose |
| description | Jetpack Compose patterns for declarative UI, state management, theming, animations, and performance optimization. |
Modern declarative UI patterns for Android.
// ✅ CORRECT: Stateless composable
@Composable
fun Counter(
count: Int,
onIncrement: () -> Unit,
modifier: Modifier = Modifier
) {
Row(modifier = modifier) {
Text("Count: $count")
Button(onClick = onIncrement) {
Text("+")
}
}
}
// Parent owns state
@Composable
fun CounterScreen() {
var count by rememberSaveable { mutableStateOf(0) }
Counter(
count = count,
onIncrement = { count++ }
)
}
// remember - Survives recomposition
val alpha by remember { mutableStateOf(1f) }
// rememberSaveable - Survives config change
var count by rememberSaveable { mutableStateOf(0) }
// remember with key - Resets on key change
val animation = remember(itemId) { Animatable(0f) }
// derivedStateOf - Computed, updates only when result changes
val isValid by remember {
derivedStateOf { email.isNotBlank() && password.length >= 8 }
}
@Composable
fun AppBar(
title: @Composable () -> Unit,
navigationIcon: @Composable () -> Unit = {},
actions: @Composable RowScope.() -> Unit = {}
) {
TopAppBar(
title = { title() },
navigationIcon = { navigationIcon() },
actions = actions
)
}
// Usage
AppBar(
title = { Text("Home") },
navigationIcon = { IconButton(onClick = {}) { Icon(Icons.Default.Menu, null) } },
actions = {
IconButton(onClick = {}) { Icon(Icons.Default.Search, null) }
}
)
@Composable
fun CustomButton(
onClick: () -> Unit,
modifier: Modifier = Modifier, // First optional parameter
enabled: Boolean = true,
content: @Composable RowScope.() -> Unit
) {
Button(
onClick = onClick,
modifier = modifier, // Apply modifier first
enabled = enabled,
content = content
)
}
@Composable
fun HomeScreen(viewModel: HomeViewModel) {
// Runs once
LaunchedEffect(Unit) {
viewModel.loadData()
}
// Runs when key changes
LaunchedEffect(userId) {
viewModel.loadUser(userId)
}
}
@Composable
fun LifecycleObserver(onResume: () -> Unit) {
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) onResume()
}
lifecycleOwner.lifecycle.addObserver(observer)
onDispose {
lifecycleOwner.lifecycle.removeObserver(observer)
}
}
}
@Composable
fun AppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
val colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme
MaterialTheme(
colorScheme = colorScheme,
typography = AppTypography,
content = content
)
}
// Usage
val backgroundColor = MaterialTheme.colorScheme.surface
val textStyle = MaterialTheme.typography.bodyLarge
LazyColumn {
items(
items = users,
key = { it.id } // Critical for performance
) { user ->
UserItem(user = user)
}
}
val alpha by animateFloatAsState(
targetValue = if (visible) 1f else 0f,
animationSpec = tween(durationMillis = 300)
)
val size by animateDpAsState(
targetValue = if (expanded) 200.dp else 100.dp
)
AnimatedContent(
targetState = state,
transitionSpec = {
fadeIn() togetherWith fadeOut()
}
) { targetState ->
when (targetState) {
is Loading -> LoadingContent()
is Success -> SuccessContent(targetState.data)
is Error -> ErrorContent()
}
}
Remember: Compose is declarative. Describe the UI, don't command it.