Assigned
Status Update
Comments
ni...@hinge.co <ni...@hinge.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.
ni...@hinge.co <ni...@hinge.co> #3
Turns out, we already had a tracking bug for this issue, will follow up on that other one.
sa...@squareup.com <sa...@squareup.com> #4
Thank you for promptly replying to my report. You are right that the issue you've just mentioned is similar to mine. I shall continue observing the progress over there.
an...@google.com <an...@google.com> #5
Note: the root cause might be similar to the one from b/329417380
Description
I'm using
GraphicsLayer
for recording a composable and drawing it in another location. When the destination exists in a different node in the hierarchy -- such that it does not share a root node -- the drawing does not work.If you run the following code, you'll notice that the counter starts at
0
, but never updates. I was able to fix this by manually invalidating my draw scope, but should this be supported out of the box?