Baseflow / Baseflow/PhotoView

Zoom get reset when layout change

Open
#168 22 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

Hi,

I've used PhotoView with an activity full screen. I hide/show the actionbar on user click.

When that happens any zoom get reset to the default, same goes for when I rotate the device.

Is this expected behavior?
I've scrambled the code in PhotoViewAttacher and saw the onGlobalLayout() method which apparently is there to recompute the zoom.

Unfortunately my experience with custom view is sparse and I couldn't really get the grip of what's going on in there at a quick reading.

I'm using Android 4.4 Kitkat and library version 1.2.2 version

To intercept the touch events I created a custom ViewGroup extending the FrameLayout and pass the MotionEvent(s) to my a gesture detector using onInterceptEvent (I always return false, do not intercept) and when I identify a tap I toggle the actionbar show state.

Of course this also happen when you rotate the device (orientation change).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.