Yuito-app-android/app/src/main/java/com/keylesspalace/tusky/components/compose
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
..
dialog Fix image zoom / pan / scroll / swipe (#3894) 2023-07-31 12:44:01 +02:00
view update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
ComposeActivity.kt Show the throwable error message when an upload fails (#3838) 2023-07-26 23:36:29 +02:00
ComposeAutoCompleteAdapter.kt modernize autocomplete (#2510) 2022-05-17 19:55:37 +02:00
ComposeTokenizer.kt update Kotlin to 1.7.10 and fix some (new?) warnings (#2647) 2022-08-07 19:36:09 +02:00
ComposeViewModel.kt Improve prompts when draft is empty (#3699) 2023-06-13 15:45:17 +02:00
ImageDownsizer.kt update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
MediaPreviewAdapter.kt update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00
MediaUploader.kt update ktlint plugin to 11.3.1, format code (#3442) 2023-03-13 13:16:39 +01:00