Skip to content

Instantly share code, notes, and snippets.

@pablobaldez
Created March 12, 2021 19:22
Show Gist options
  • Save pablobaldez/dc58441c442fbbeabf3a7ec85e5f3ee9 to your computer and use it in GitHub Desktop.
Save pablobaldez/dc58441c442fbbeabf3a7ec85e5f3ee9 to your computer and use it in GitHub Desktop.
Row with rtl provider
@Composable
fun RegularRow(
modifier: Modifier = Modifier,
leftIcon: @Composable (RowScope.() -> Unit)? = null,
detail: @Composable (() -> Unit)? = null,
rightIcon: @Composable (RowScope.() -> Unit)? = null,
title: @Composable () -> Unit
) {
FoundationRow(
modifier = modifier.wrapContentHeight()
) {
...
detail?.let {
Box(
modifier = Modifier.wrapContentWidth(),
contentAlignment = Alignment.CenterEnd
) {
Providers(AmbientLayoutDirection provides LayoutDirection.Rtl) {
detail.invoke()
}
}
}
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment