Fix image zoom / pan / scroll / swipe (#3894)
Migrate to touchimageview from photoview, and adjust the touch logic to correctly handle single finger drag, two finger pinch/stretch, flings, taps, and swipes. As before, the features are: - Single tap, show/hide controls and media description - Double tap, zoom in/out - Single finger drag up/down, scale/translate image, dismiss if scrolled too far - Single finger drag left/right - When not zoomed, swipe to next image if multiple images present - When zoomed, scroll to edge of image, then to next image if multiple images present - Two finger pinch/zoom, zoom in/out on the image Behaviour differences to previous code 1. Bug fix: The image can't get "stuck" when zoomed, and impossible to scroll 2. Bug fix: Pinching is not mis-interpreted as a fling, closing the image 3. Bug fix: The zoom state of images is not lost or misinterpreted when the user swipes through multiple images 4. Bug fix: Double-tap zooms all the way, instead of stopping 5. Tapping outside the image does not dismiss it, controls and description show/hide Fixes https://github.com/tuskyapp/Tusky/issues/3562, https://github.com/tuskyapp/Tusky/issues/2297
This commit is contained in:
parent
30be3ce1f0
commit
79ee2dc32c
6 changed files with 145 additions and 87 deletions
|
|
@ -51,7 +51,7 @@ class CaptionDialog : DialogFragment() {
|
|||
|
||||
input = binding.imageDescriptionText
|
||||
val imageView = binding.imageDescriptionView
|
||||
imageView.maximumScale = 6f
|
||||
imageView.maxZoom = 6f
|
||||
|
||||
input.hint = resources.getQuantityString(
|
||||
R.plurals.hint_describe_for_visually_impaired,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue