Skip to content

Instantly share code, notes, and snippets.

View muankit's full-sized avatar
🏠
Working from home

Ankit muankit

🏠
Working from home
View GitHub Profile
@muankit
muankit / gist:39912ffb5251ed009ecbc8e2fcc62614
Created December 21, 2022 09:48
Composition Local Provide is not updating child compose if provider value changed at runtime
@Composable
fun ScreenUI() {
val isRtl = if (viewModel.isRtl) {
LocalLayoutDirection provides LayoutDirection.Rtl
} else {
LocalLayoutDirection provides LayoutDirection.Ltr
}
CompositionLocalProvider(isRtl) {
ConstraintLayout(modifier = Modifier.fillMaxSize()) {