Replies: 1 comment
-
The underlying issue for #415 was due to having two different call-sites for the same composable method. When a composable method is called multiple times, the "identity" of that composable is based on its call-site and the call-sites of the full call hierarchy. That allows calling the same composable method multiple times in different places, with independent state for different places where the composable method is called. However, that independent state can result in buggy behavior when the goal is that state is shared. The There's two solutions to this problem, where state is being reset undesirably:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I have checked the latest version of Now in Android app and it seems that the problem is gone now but...
...until this moment of development, the problem was present multiple times and involved different tabs of the navigation bar. For instance, the bug #415 was reported and fixed but the cause of that problem wasn't so obvious or even related to the scroll itself.
At this time, I am in the development process of an app and must admit that I struggle with the same problem. Even more, I have built a screen that has horizontal pager and column with a vertical scroll. Have no clue why when entering into that screen by clicking on the navigation tab makes the state partially lost - the scroll position is lost but the pager state is restored properly.
I've encountered even more weird problems. State was properly saved and restored only when there were no if-statements/when-statements, e.g. to check whether any error occurred and show ErrorState (Composable) or ContentState (Composable) otherwise.
That's why I would like to ask for general reasons/clues why such unwanted behavior might happen?
Beta Was this translation helpful? Give feedback.
All reactions