Skip to content

Instantly share code, notes, and snippets.

@malihehmoradi
Last active October 7, 2023 16:30
Show Gist options
  • Save malihehmoradi/40cf3ada81e736a8553c3c88c7723baa to your computer and use it in GitHub Desktop.
Save malihehmoradi/40cf3ada81e736a8553c3c88c7723baa to your computer and use it in GitHub Desktop.
TextAlign.Justify doesn't work with Persian text in Text composable, just put it in a CompositionLocalProvider with LayoutDirection.Rtl for working. #android #compose #kotlin
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl) {
Text(
text = stringResource(id = R.string.contactUs),
textAlign = TextAlign.Justify,
modifier = Modifier
.fillMaxWidth()
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment