Created
January 25, 2026 13:52
-
-
Save linreal/7017679e9adf5cae1687eef69f0aad90 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
| // Looks innocent, but creates multiple expensive layers | |
| @Composable | |
| fun ElegantCard(content: @Composable () -> Unit) { | |
| Card( | |
| modifier = Modifier | |
| .fillMaxWidth() | |
| .padding(16.dp) | |
| .alpha(0.95f) // Layer #1: Transparency | |
| .clip(RoundedCornerShape(12.dp)) // Layer #2: Clipping path | |
| .shadow(8.dp, RoundedCornerShape(12.dp)) // Layer #3: Often another layer | |
| .background(MaterialTheme.colorScheme.surface) | |
| ) { | |
| content() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment