Yuito-app-android/app/src/main/java/com/keylesspalace/tusky/components
Nik Clayton 79ee2dc32c
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
2023-07-31 12:44:01 +02:00
..
account Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
accountlist Cache locked state of connected accounts (#3790) 2023-07-27 00:09:26 +02:00
announcements update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
compose Fix image zoom / pan / scroll / swipe (#3894) 2023-07-31 12:44:01 +02:00
conversation Migrate "room" from "kapt" to "ksp" (#3777) 2023-06-29 18:37:46 +02:00
drafts update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
filters Always update the filter display, even when the list is empty (#3880) 2023-07-27 13:44:28 +02:00
followedtags Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
instanceinfo fix caching of instance defaults and emojis (#2643) 2022-08-07 22:18:53 +02:00
instancemute Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
login Replace deprecated getParcelable* methods with compat versions (#3633) 2023-06-11 12:58:55 +02:00
notifications Show notifications from workers (#3760) 2023-06-29 18:37:27 +02:00
preference Provide a preference to scale all UI text (#3248) 2023-06-29 18:34:56 +02:00
report Ensure text field has focus when reporting statuses 2023-05-04 14:53:27 +02:00
scheduled Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
search Retain text in search view when switching tabs before first search (#3540) 2023-07-19 11:40:08 +02:00
timeline Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00
trending Check for empty trending response (#3853) 2023-07-19 09:39:07 +02:00
viewthread Simplify repeated code that shows errors (#3762) 2023-06-19 23:49:20 +02:00