Assigned
Status Update
Comments
lp...@google.com <lp...@google.com> #2
This actually has nothing to do with NavHostFragment, but is the behavior of NavController's setGraph().
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
mo...@google.com <mo...@google.com> #3
Turns out, we already had a tracking bug for this issue, will follow up on that other one.
Description
Jetpack Compose version: 1.8.0-beta2
Jetpack Compose component used: Dialog
Android Studio Build: 2024.3.2 Canary 6
Kotlin version: 2.1.10
From Compose 1.8 alphas and betas, setting
decorFitsSystemWindows
tofalse
disables all Dialog entry/exit animations. This is a behaviour change from Compose 1.7 and does not appear to be mentioned in any release notes as an intended change as far as I can see.I imagine this is caused by the fix to allow dialog content to properly draw behind system UI. That change is very much desirable, but it would be good for Compose to either (a) restore the "standard" entry/exit animations, or (b) if this isn't possible/is undesirable due to the drawing area changes, provide some simple code migration path or sample for us to restore this animation behaviour ourselves.
See attached videos.
Steps to Reproduce or Code Sample to Reproduce: