Skip to content

Instantly share code, notes, and snippets.

@linreal
Created January 25, 2026 13:46
Show Gist options
  • Select an option

  • Save linreal/362596a6c7dc893a813af9aec047310d to your computer and use it in GitHub Desktop.

Select an option

Save linreal/362596a6c7dc893a813af9aec047310d to your computer and use it in GitHub Desktop.
// Common pattern - creates performance and UX issues
@Composable
fun ListItem(title: String, subtitle: String, onClick: () -> Unit) {
Row(
modifier = Modifier
.clickable { onClick() } // 1. Interaction first?
.fillMaxWidth() // 2. Then Layout...
.padding(16.dp) // 3. ...and more layout
.background( // 4. Finally, appearance
color = Color.LightGray,
shape = RoundedCornerShape(8.dp)
)
) {
// ... Content
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment