Marcin Wisniowski
06/18/2022, 7:10 PMhttps://raw.githubusercontent.com/googlesamples/mlkit/master/android/material-showcase/screenshots/live_barcode.gif▾
Marcin Wisniowski
06/18/2022, 7:15 PMMarcin Wisniowski
06/18/2022, 7:37 PMdrawRect()
to cover the entire area then draw the cutout shape with blendMode = BlendMode.Clear
.ste
06/19/2022, 8:47 AMclipPath
as well:
val rectPath = Path().apply {
addRoundRect(
RoundRect(
rect = rect,
cornerRadius = CornerRadius(
x = 16.dp.toPx(),
y = 16.dp.toPx()
)
)
)
}
clipPath(path = rectPath, clipOp = ClipOp.Difference) {
drawRect(
size = size,
color = Color.Black,
alpha = 0.33f,
)
}