usuiat / Zoomable

Jetpack Compose library that enables contents zooming with pinch gesture.
https://usuiat.github.io/Zoomable/
Apache License 2.0
342 stars 16 forks source link

State Restoration #160

Open T8RIN opened 6 months ago

T8RIN commented 6 months ago

add rememberSaveable instead of remember and option to control it

usuiat commented 4 months ago

Zoomable intentionally does not use rememberSaveable. This is because I believe that zooming an image is a temporary operation that depends on the screen configuration, and therefore it is better not to save the state. Using rememberSaveable will save the zoom state even when the screen size changes, but if the screen size changes, the optimal zoom scale should also change. Therefore, I dare not use rememberSaveable and return to the default scale when the screen size changes.

Of course, this is my opinion. If you have a reason why I should use rememberSaveable, please let me know. Anyone's opinion is welcome.