CurvedText is a component allowing developers to easily write curved text following the curvature a circle (usually at the edge of a circular screen).
CurvedTextBottom
@Composable
fun CurvedTextBottom() {
val backgroundColor = MaterialTheme.colorScheme.onPrimary
CurvedLayout(anchor = 90f, angularDirection = CurvedDirection.Angular.Reversed) {
curvedRow(CurvedModifier.background(backgroundColor, Round)) {
curvedComposable {
Icon(
Icons.Filled.Warning,
contentDescription = "Warning",
modifier = Modifier.size(ButtonDefaults.IconSize),
)
}
curvedText(
"Network lost",
maxSweepAngle = CurvedTextDefaults.StaticContentMaxSweepAngle,
overflow = TextOverflow.Ellipsis,
)
}
}
}
CurvedTextTop
@Composable
fun CurvedTextTop() {
val backgroundColor = MaterialTheme.colorScheme.onPrimary
val customColor = MaterialTheme.colorScheme.tertiaryDim
CurvedLayout {
curvedRow(CurvedModifier.background(backgroundColor, Round)) {
curvedText("Calling", color = customColor)
curvedBox(CurvedModifier.angularSizeDp(5.dp)) {}
curvedText("Camilia Garcia")
}
}
}