Tash
11/29/2021, 9:24 PMsnapshotFlow
to observe `mutableStateOf<T>`s in `Fragment`s. Noticing that withMutableSnapshot
is required when updating the state (from Android View callbacks for example) in order to propagate updates, but I don’t understand why it’s required in this case… 🤔zsperske
11/29/2021, 9:38 PMCard(onClick = { viewModel.postEvent(EventListUIEvent.EventSelected(eventState.event)) } )
I want to make a decision on where to go next without my composable knowing about its potential destinations.jeff
11/29/2021, 10:41 PMModifier.alpha(0f)
the Compose equivalent of View.INVISIBLE
? In regards both to performance and things like screen readers? Is there something better I should be doing?Arsen
11/29/2021, 11:16 PMbrabo-hi
11/30/2021, 12:16 AMscaffoldState.snackbarHostState
it only has drawerState
?amiracam
11/30/2021, 3:57 AMK Merle
11/30/2021, 7:38 AMJohan Reitan
11/30/2021, 10:24 AMViewModel
. I expected that I could use the SavedStateHandle
injected in my ViewModel
to listen to the navigation result, but I see that this SavedStateHandle
is not the same as the one from the NavBackStackEntry
that holds the result. Details in thread 🧵Erlan Amanatov
11/30/2021, 11:10 AMSamir Basnet
11/30/2021, 12:21 PMval scrollState = rememberLazyListState()
val lazyInsuranceItems = pager.collectAsLazyPagingItems()
LazyColumn(state = scrollState) {
itemsIndexed(lazyInsuranceItems) { index,insurance ->
InsuranceCell(insurance!!) {
navController.navigate("InsuranceDetail/${insurance.id}")
}
} }
Trying to create list and detail screens as above but on returing to list the scroll position is lost and returns to top. Can anyone guide me on how to maintain scroll position?Tim Malseed
11/30/2021, 12:27 PMPaul
11/30/2021, 1:08 PMArsen
11/30/2021, 1:23 PMiamthevoid
11/30/2021, 1:32 PMstate.animateScrollToPage
all works correctBrian G
11/30/2021, 1:39 PMArchie
11/30/2021, 2:03 PMKiprop Victor
11/30/2021, 2:06 PMColton Idle
11/30/2021, 3:04 PMstyle = MaterialTheme.typography.h1,
but have the "h1" be a variable.
like
val myStyle = "h1"
then have
style = MaterialTheme.typography.+myStyle
Slackbot
11/30/2021, 5:46 PMbrabo-hi
11/30/2021, 6:20 PMtheapache64
11/30/2021, 7:04 PM@AssistedInject
with Navigation Compose’s hiltViewModel
method?
More Info ➡️ 😒tackoverflow: https://stackoverflow.com/questions/70174711/how-to-do-assisted-injection-with-navigation-composejeff
11/30/2021, 8:41 PMJoseph Hawkes-Cates
11/30/2021, 10:50 PMChris Fillmore
11/30/2021, 11:09 PMHalfExpanded
or Expanded
state? In particular, what I observe is that when the bottom sheet content is more than 50% of the screen height, and the bottom sheet is HalfExpanded
, then the element is positioned below the bottom of the screen (not visible). If I drag it to Expanded
state, then the positioned element becomes visible. For example:
// I'm using bottom sheet navigation
bottomSheet(...) {
Box {
Column {
// Some content here
}
Row(
// Alignment from BoxScope
modifier = Modifier.align(Alignment.BottomCenter)
) {
// I have some buttons I want to put here that will remain at the bottom of the screen while the bottom sheet is open
}
}
}
ursus
12/01/2021, 12:38 AMColton Idle
12/01/2021, 4:22 AMinline fun Modifier.modifyIf(condition: Boolean, then: Modifier.() -> Modifier): Modifier =
if (condition) then() else this
2.
inline fun Modifier.thenIf(condition: Boolean, block: () -> Modifier) =
this.then(if (condition) block() else Modifier)
Number 1 does not work for me (it actually messed up my modifier), while number 2 works exactly as expected.
I'm not sure why. Any ideas?Filip Wiesner
12/01/2021, 8:18 AMAnimatedVisibility
? I tried fade
with tween(duration = 0)
but there is still small delay before the view disappears.Slackbot
12/01/2021, 9:11 AMMarcello Galhardo
12/01/2021, 1:55 PMMichal Klimczak
12/01/2021, 2:14 PM0.18.x
version and try to make it compatible with new compose. Anyone knows what is the roadmap here?Michal Klimczak
12/01/2021, 2:14 PM0.18.x
version and try to make it compatible with new compose. Anyone knows what is the roadmap here?cb
12/01/2021, 2:19 PMMichal Klimczak
12/01/2021, 2:21 PMStylianos Gakis
12/01/2021, 2:26 PMAndrey Kulikov
12/01/2021, 2:45 PMMichal Klimczak
12/01/2021, 2:47 PM