andrew
08/24/2022, 2:34 PMandrew
08/24/2022, 2:34 PMChris Sinco [G]
08/24/2022, 2:43 PMandrew
08/24/2022, 2:45 PMNader Jawad
08/24/2022, 7:30 PMandrew
08/24/2022, 7:53 PMNader Jawad
08/24/2022, 7:59 PMandrew
08/24/2022, 8:21 PMNader Jawad
08/24/2022, 8:22 PMChris Sinco [G]
08/24/2022, 9:42 PMColton Idle
05/15/2023, 3:42 AMColton Idle
05/15/2023, 3:42 AMandrew
05/15/2023, 1:47 PMNader Jawad
05/15/2023, 2:10 PMandrew
05/15/2023, 2:10 PMandrew
05/15/2023, 2:11 PMNader Jawad
05/15/2023, 2:14 PMColton Idle
05/15/2023, 8:12 PM.border(1.dp, BorderStyle.Clip)
on my icon it'd be clutch.
And thats just because the
drawCircle(
Color.Black,
size.minDimension / 2,
size.center,
style = stroke,
blendMode = BlendMode.Clear
)
doesn't scale correctly with my image. While a border works just fine if I set the border to white. But if I use a different background color then the effect is broken. 😅Nader Jawad
05/15/2023, 8:35 PMColton Idle
05/15/2023, 8:38 PMNader Jawad
05/16/2023, 7:53 PMBox(modifier = Modifier.fillMaxSize()
.wrapContentSize(Alignment.Center)
// Leverage an offscreen rasterization of the box composable so we can use use the clear
// blend mode to erase/mask out some pixels without clearing the original destination pixels
.graphicsLayer{ compositingStrategy = CompositingStrategy.Offscreen }
) {
Image(
Icons.Outlined.AccountCircle,
"ProfileImage",
Modifier.size(48.dp).padding(top = 5.dp),
contentScale = ContentScale.FillBounds
)
Text(text = "2",
color = Color.White,
textAlign = TextAlign.Center,
modifier = Modifier.align(Alignment.TopEnd).size(20.dp).drawWithContent {
// Color doesn't matter here but clear out a circle of pixels slightly larger
// than the area of the text composable
drawCircle(color = Color.Black, blendMode = BlendMode.Clear, radius = this.size.minDimension / 2 + 5f)
// Draw a red background circle smaller than the area that was masked out above
drawCircle(color = Color.Red)
drawContent()
})
}
Nader Jawad
05/16/2023, 7:54 PM