basicCurvedText
Function
Android
public fun CurvedScope.basicCurvedText(
text: String,
modifier: CurvedModifier = CurvedModifier,
angularDirection: CurvedDirection.Angular? = null,
overflow: TextOverflow = TextOverflow.Clip,
style: @Composable () -> CurvedTextStyle = { CurvedTextStyle() },
): Unit
basicCurvedText
is a component allowing developers to easily write curved text following the
curvature a circle (usually at the edge of a circular screen). basicCurvedText
can be only
created within a CurvedLayout
since it's not a composable.
Parameters
text | The text to display |
modifier | The CurvedModifier to apply to this curved text. |
angularDirection | Specify if the text is laid out clockwise or anti-clockwise, and if those needs to be reversed in a Rtl layout. If not specified, it will be inherited from the enclosing curvedRow or CurvedLayout See CurvedDirection.Angular . |
overflow | How visual overflow should be handled. |
style | A @Composable factory to provide the style to use. This composable SHOULDN'T generate any compose nodes. |
Android
public fun CurvedScope.basicCurvedText(
text: String,
style: CurvedTextStyle,
modifier: CurvedModifier = CurvedModifier,
angularDirection: CurvedDirection.Angular? = null,
overflow: TextOverflow = TextOverflow.Clip,
): Unit
basicCurvedText
is a component allowing developers to easily write curved text following the
curvature a circle (usually at the edge of a circular screen). basicCurvedText
can be only
created within a CurvedLayout
since it's not a composable.
Parameters
text | The text to display |
style | A style to use. |
modifier | The CurvedModifier to apply to this curved text. |
angularDirection | Specify if the text is laid out clockwise or anti-clockwise, and if those needs to be reversed in a Rtl layout. If not specified, it will be inherited from the enclosing curvedRow or CurvedLayout See CurvedDirection.Angular . |
overflow | How visual overflow should be handled. |
Code Examples
CurvedAndNormalText
@Composable
fun CurvedAndNormalText() {
CurvedLayout(modifier = Modifier.fillMaxSize()) {
basicCurvedText(
"Curved Text",
CurvedModifier.padding(10.dp),
style = {
CurvedTextStyle(fontSize = 16.sp, color = Color.Black, background = Color.White)
},
)
curvedComposable { Box(modifier = Modifier.size(20.dp).background(Color.Gray)) }
curvedComposable {
BasicText(
"Normal Text",
Modifier.padding(5.dp),
TextStyle(fontSize = 16.sp, color = Color.Black, background = Color.White),
)
}
}
}