Assigned
Status Update
Comments
em...@well.co <em...@well.co> #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.
Description
composeBom = "2024.04.01"
Jetpack Compose component(s) used:
LazyColumn, AndroidView for WebView
Android Studio Build:
Android Studio Ladybug | 2024.2.1 Patch 2
Kotlin version:
2.0.0
Steps to Reproduce or Code Sample to Reproduce:
Greenfield app:
1. Add a webview wrapped with AndroidView between the items. Don't add a height modifier, so it should take
2. Load content to webview locally - should be a long content so that it makes the screen scrollable.
3. Add onSizeChanged modifier to webview
4. Everytime the orientation changes WebView starts with 24px height and then gets recomposed to fit the content. This makes scroll position calculations erroneous.