Created
January 25, 2026 13:35
-
-
Save linreal/50132bbc337ae5ed39a6d95f155fe14e 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
| // Before: A typical "just make it work" modifier chain | |
| // Before: "works", but heavier than it looks | |
| Modifier | |
| .clickable { onMessageClick() } // hit-test too early | |
| .padding(horizontal = 12.dp, vertical = 6.dp) | |
| .background( | |
| color = MaterialTheme.colorScheme.surfaceVariant, | |
| shape = RoundedCornerShape(12.dp) | |
| ) | |
| .fillMaxWidth() | |
| .padding(8.dp) // extra layout work | |
| .alpha(0.98f) // layer A | |
| .clip(RoundedCornerShape(12.dp)) // layer B + path work | |
| .shadow(4.dp, RoundedCornerShape(12.dp)) // layer C (often) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment