Daniele Segato
07/30/2021, 9:22 AMnavigation-compose 2.4.0-alpha05
and my LazyColumns were broken.
I've investigated and it looks like rememberSaveable
usage without a key has been broken. Upon navigation and back it is not restored because currentCompositeKeyHash
has changed.
This means rememberLazyListState()
doesn't work if you leave a list into a detail and than back it scrolls back up cause it creates a new LazyListState
@Ian Lake I'm tagging you because I saw you are on top of this kind of issues in other comments and I suppose this information can help you solve other issues with this release. If you do not want me to ping like that I won't do it again.
I can (and will) create a bug report: just do not have time now and just wanted to let you guys know of the issue as fast as I could. -- I'll link it here in a response
Other issues I noticed:
I had a login flow working like this:
routes:
• EntryPoint
• Login
• Registration
the Entry point sent directly to either login or registration with a LaunchedEffect
controlled by a StateFlow in the viewmodel. When entering the screen I would mark it to exit when coming back. This allowed me to handle the logic of setting backStackEntry arguments as results of the auth flow.
with the old navigation after navigating to login the launched effect didn't receive the "go back" event until the user re-entered the entry point screen while with alpha05 it immediately execute the back call.
This was fixed using lifecycle.whenStarted { }
to handle the navigation back -- but you might wanna mention this as side effect in the release notes.Tgo1014
07/30/2021, 10:34 AMScrollableState
is scrollable aka all the content is already being shown?Csaba Szugyiczki
07/30/2021, 11:12 AMpainterResource
Is it possible to apply antialiasing or something similar to improve image quality?
Icon(
painterResource(R.drawable.ic_map_compass),
contentDescription = stringResource(R.string.map_compass_button_content_desription),
tint = Color.Unspecified,
modifier = Modifier.rotate(
-bearing
)
)
Joey
07/30/2021, 12:52 PMThiago
07/30/2021, 12:58 PMAman Kapoor
07/30/2021, 1:36 PMDaniel Weidensdörfer
07/30/2021, 2:17 PMloloof64
07/30/2021, 2:44 PMFlowLayout
using the Layout
composable. But for this to work, I need the available width.Alexa_Gal
07/30/2021, 2:57 PMcomposables
in the NavHost
have you noticed this as well? it works fine with 12 or less
java.lang.ArrayIndexOutOfBoundsException: length=13; index=13
Tin Tran
07/30/2021, 3:28 PMAnimatedVisibility
and notice some weird behavior for expandVertically
and shrinkVertically
Is this expected?MaxUt
07/30/2021, 3:35 PMNorbi
07/30/2021, 4:33 PM@Composable
fun ApplicationRoot() {
val navController = rememberNavController()
MaterialTheme {
NavHost(navController = navController, startDestination = "home") {
composable("home") {
HomeScreen()
}
}
}
}
@Composable
fun HomeScreen(viewModel: ApplicationViewModel = viewModel()) {
val applicationState by viewModel.applicationStateStore.observeAsState()
...
But if I refactor applicationState
as a parameter then it doesn't work correctly, no recomposition happens if viewModel.applicationStateStore
is modified:
@Composable
fun ApplicationRoot(viewModel: ApplicationViewModel = viewModel()) {
val applicationState by viewModel.applicationStateStore.observeAsState()
val navController = rememberNavController()
MaterialTheme {
NavHost(navController = navController, startDestination = "home") {
composable("home") {
HomeScreen(applicationState)
}
}
}
}
@Composable
fun HomeScreen(applicationState: ApplicationState) {
...
Thanks.Ian Arbuckle
07/30/2021, 5:23 PMColton Idle
07/30/2021, 8:13 PMsmallshen
07/30/2021, 9:14 PMRafs
07/30/2021, 10:33 PManimatedVisiblity
and a Button
composable, how do I prevent the Button from moving to the space occupied by the animatedVisiblity
when it is invisible.Abhishek Dewan
07/31/2021, 2:10 AMms
07/31/2021, 3:14 AMNestedScrollable
inside Column
or LazyColumn
code in 🧵loloof64
07/31/2021, 9:31 AMFlowRow
scrollable ? Or to add Scrollbars automatically around it ?Daniel Weidensdörfer
07/31/2021, 10:52 AMswipeableState
like in this example: https://developer.android.com/jetpack/compose/gestures#swiping . Since swipeableState.snapTo(...)
is a suspend function, I probably need to call it from a side effect. Whats the correct way to call this function inside of a composable?miqbaldc
07/31/2021, 4:23 PMwhen
for the sealed class
with LiveData.observeAsState
like this code in 🧵?loloof64
07/31/2021, 5:07 PM@Composable
scrollable ?Vsevolod Ganin
07/31/2021, 5:18 PMSrSouza
07/31/2021, 7:20 PMMehdi Haghgoo
07/31/2021, 9:12 PMvar inc by remember{ mutableStateOf(0)}
remember{object: CountDownTimer(100L, 1L){
override fun onTick(millisUntilFinished: Long) {
inc++
}
override fun onFinish() {
}
}.start() }
Neal Sanche
08/01/2021, 3:31 AMjames
08/01/2021, 5:52 AMDropdownMenu
appear in the position of a click? I'd like to capture the x, y position of a click event and have the DropdownMenu
anchored to that position, rather than it just anchoring itself in the default positionursus
08/01/2021, 1:03 PMLazyColumn
rather laggy on first scroll? Compared to Column with scroll (obviously since those are eagerly loaded), but also compared to RecyclerView (by feel, didnt measure though)
and fling animation is also kind of messed up, but then fixes it self after few swipes up and down; as if something heavy was loading on main threadYASAN
08/01/2021, 2:05 PMloloof64
08/01/2021, 2:50 PMMovesNavigatorElement
- which is a class I've defined - as a property of my @Composable
but it does not compile : more in threadloloof64
08/01/2021, 2:50 PMMovesNavigatorElement
- which is a class I've defined - as a property of my @Composable
but it does not compile : more in threadMovesNavigatorElement
Adam Powell
08/01/2021, 2:54 PM=
instead of by
loloof64
08/01/2021, 2:56 PMAdam Powell
08/01/2021, 2:56 PMmutableStateOf
because MutableState<T>
is essentially a collection of exactly one element and explicitly referring to its .value
property is cumbersome/noisy. Other snapshot collection types are used as usual elsewhere.loloof64
08/01/2021, 3:03 PMSnpashotMutableList
the best way to handle a mutable array of items, in order to save them as a property of Composable, like I'm trying ? Or can I do simpler ?.toTypedArray()
.Adam Powell
08/01/2021, 4:13 PMloloof64
08/01/2021, 5:10 PM