Samir Basnet
03/31/2021, 1:26 PMText(
text = "Online",
style = MaterialTheme.typography.subtitle2,
maxLines = 1,
color = MaterialTheme.colors.onSurface,
modifier = Modifier
.drawWithContent {
drawCircle(color = green, radius = 25f)
drawContent()
}
.constrainAs(online) {
start.linkTo(name.start)
top.linkTo(verifiedLogo.bottom, 10.dp)
}
)
Albert Chang
03/31/2021, 2:02 PMdrawWithContent
doesn't affect the size of the layout so you should reserve space for the circle first. Then you have to specify the position in drawCircle
otherwise the circle will be placed in the center of the layout.Samir Basnet
03/31/2021, 2:07 PMSamir Basnet
03/31/2021, 2:13 PMSamir Basnet
03/31/2021, 2:16 PMAlbert Chang
04/01/2021, 12:49 AM