Skip to content

Instantly share code, notes, and snippets.

@Oleur
Created April 22, 2021 21:51
Show Gist options
  • Save Oleur/2f03ed2b65482ef91f7fc28c41b5660b to your computer and use it in GitHub Desktop.
Save Oleur/2f03ed2b65482ef91f7fc28c41b5660b to your computer and use it in GitHub Desktop.
@Composable
fun TicketComposable(modifier: Modifier) {
Text(
text = "๐ŸŽ‰ CINEMA TICKET ๐ŸŽ‰",
style = TextStyle(
color = Color.White,
fontSize = 22.sp,
fontWeight = FontWeight.Black,
),
textAlign = TextAlign.Center,
modifier = modifier
.wrapContentSize()
.graphicsLayer {
shadowElevation = 8.dp.toPx()
shape = TicketShape(24.dp.toPx())
clip = true
}
.background(color = dark)
.drawBehind {
scale(scale = 0.9f) {
drawPath(
path = drawTicketPath(size = size, cornerRadius = 24.dp.toPx()),
color = red700,
style = Stroke(
width = 2.dp.toPx(),
pathEffect = PathEffect.dashPathEffect(floatArrayOf(10f, 10f))
)
)
}
}
.padding(start = 32.dp, top = 64.dp, end = 32.dp, bottom = 64.dp)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment