Skip to content

Instantly share code, notes, and snippets.

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

  • Save linreal/0de55a457a62fb807465c958f5f08cc3 to your computer and use it in GitHub Desktop.

Select an option

Save linreal/0de55a457a62fb807465c958f5f08cc3 to your computer and use it in GitHub Desktop.
// After: same visual, fewer layers, bounded ripple
Modifier
.fillMaxWidth() // layout first
.padding(12.dp)
.graphicsLayer { // consolidate heavy ops
alpha = 0.98f
shape = RoundedCornerShape(12.dp)
clip = true
shadowElevation = 4.dp.toPx()
}
.background(MaterialTheme.colorScheme.surfaceVariant) // drawn inside layer & clipped
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(bounded = true)
) { onMessageClick() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment