On Android we can use android determine if device is in right to left language/layout.
But does Jetpack Compose provide any API to check the layout direction? Without interacting with the resources or other Android APIs.
On Android we can use android determine if device is in right to left language/layout.
But does Jetpack Compose provide any API to check the layout direction? Without interacting with the resources or other Android APIs.
We can use LocalLayoutDirection
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.fillMaxSize()
) {
if (LocalLayoutDirection.current == LayoutDirection.Rtl) {
Text("RTL")
} else {
Text("LTR")
}
}