Skip to content

Instantly share code, notes, and snippets.

@PhilipDukhov
Created March 27, 2022 22:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipDukhov/53c66789f631a2ebd63656e7f972f343 to your computer and use it in GitHub Desktop.
Save PhilipDukhov/53c66789f631a2ebd63656e7f972f343 to your computer and use it in GitHub Desktop.
@Composable
inline fun LtrRow(
modifier: Modifier = Modifier,
horizontalArrangement: Arrangement.Horizontal = Arrangement.Start,
verticalAlignment: Alignment.Vertical = Alignment.Top,
crossinline content: @Composable RowScope.() -> Unit
) {
val direction = LocalLayoutDirection.current
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Ltr) {
Row(
modifier = modifier,
horizontalArrangement = horizontalArrangement,
verticalAlignment = verticalAlignment,
) {
CompositionLocalProvider(LocalLayoutDirection provides direction) {
content()
}
}
}
}
@andrejazivkovic
Copy link

This so smart !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment