Skip to content

Instantly share code, notes, and snippets.

@raipankaj
Created Jun 10, 2022
Embed
What would you like to do?
Mirror effect Jetpack Compose
@Composable
fun Mirror(content: @Composable () -> Unit) {
Column {
content()
Box(modifier = Modifier
.graphicsLayer {
alpha = 0.99f
rotationZ = 180f
}
.drawWithContent {
val colors = listOf(Color.Transparent, Color.White)
drawContent()
drawRect(brush = Brush.verticalGradient(colors),
blendMode = BlendMode.DstIn)
}
.blur(radiusX = 1.dp, radiusY = 3.dp, BlurredEdgeTreatment.Unbounded)
.clip(
HalfSizeShape
)
) {
content()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment