Created
January 25, 2026 13:46
-
-
Save linreal/362596a6c7dc893a813af9aec047310d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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