Closed MitulVarmora closed 4 months ago
That's a very interesting usecase!
I would like to save user's last zoom and offset
What value do you plan to save? ZoomableState#zoomFraction
or ZoomableState#contentTransformation
?
What value do you plan to save?
ZoomableState#zoomFraction
orZoomableState#contentTransformation
?
ZoomableState#contentTransformation
because thats what contains offset
and scale
both.
Another application involves utilizing PredictiveBackHandler
to animate zoom scale and offset, such as scaling back to the original size when the user presses the back button with predictive back functionality.
@Tlaster can you use ZoomableState#resetZoom()
for that?
@Tlaster can you use
ZoomableState#resetZoom()
for that?
ZoomableState#resetZoom()
will reset the zoom instantly, with PredictiveBackHandler
we can get a progress that indicate how many "back" user has been dragged, so we can use the progress to set the scale and offset programmatically. For more about predictive back: https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture
@Tlaster interesting. Is there a reason you want to change the scale/offset on every frame during the back gesture? I haven't seen any apps do that.
@Tlaster interesting. Is there a reason you want to change the scale/offset on every frame during the back gesture? I haven't seen any apps do that.
Just a thought, like a gallery app when user scale up a photo then want to reset the scale by back gesture, it would be nice to have an animation during back gesture.
In my application I use object detection model to detect objects on a photo. Then I want to zoom an image to a specific location with detected object.
The next release will introduce new APIs for controlling an image's pan and zoom:
I am building an app in which I would like to save user's last zoom and offset and restore it when user revisit same image. As of now lib version 0.8.0: There is no way to change zoom and offset programatically.
Please provide a way to change zoom and offset programatically. This is important to my app because that way user will continue editing image from where they left.