Created
March 12, 2021 19:22
-
-
Save pablobaldez/dc58441c442fbbeabf3a7ec85e5f3ee9 to your computer and use it in GitHub Desktop.
Row with rtl provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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