Open MHShetty opened 1 month ago
Activity is recreated after almost all configuration changes, not just after rotation. Proper solution for this is to use a ViewModel or to save activity state in onSaveInstanceState().
The proposed solution doesn't work in my testing even for orientation changes, not clear why.
Special handling of lastCapturedItem should be skipped when lastViewedMediaPosition is not 0, otherwise decoding of item at lastViewedMediaPosition will be delayed until decoding of lastCapturedItem is complete.
Special handling of lastCapturedItem should be skipped when lastViewedMediaPosition is not 0, otherwise decoding of item at lastViewedMediaPosition will be delayed until decoding of lastCapturedItem is complete.
Yes, loading the first item would be un-necessary in this case. Thanks a lot for reviewing this PR!
Item position is not guaranteed to be stable after the item list is re-fetched, missed that initially. A stable item identifier should be saved in onSaveInstanceState
, not its position.
Hi @muhomorr,
I have updated the code to use CapturedItem
based comparison to identify the position of the slider over just saving the position to address this issue. Thank you for mentioning this out!
Regards, Mohit
Changing the orientation in the in-app gallery currently causes the entire gallery activity to reset
This pull request would help resolve the issue described at #370