feat(viewer): add pinch-to-zoom for photos on Android
Add pinch/pan/double-tap zoom to the full-screen photo viewer, mirroring the web viewer semantics: - scale is a multiplier of the natural size, capped at 200%; the fitted view is the lower bound - double tap toggles fitted view <-> 100% natural anchored at the tap - the original loads on zoom, with the preview kept as a placeholder so entering zoom never flashes a black surface - the pager is disabled while zoomed (drags pan the image) and the zoom resets when leaving a photo - video and 360 panoramas are unaffected Implement PhotoZoom (zoom math) and ZoomableImage (gestures), wire it into ViewerContent/MediaPage, and cover it with unit, Compose and device tests. OpenSpec change: add-mobile-photo-zoom
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# Tasks
|
||||
|
||||
## 1. Zoomable image component
|
||||
|
||||
- [x] 1.1 Implement зум-математику (диапазон `[fitScale, 2.0]`, якорь в точку жеста) отдельным
|
||||
тестируемым помощником; проверить юнит-тестом клампы предела и пересчёт якоря при double-tap
|
||||
- [x] 1.2 Реализовать слой жестов (pinch + панорамирование при зуме + double-tap) над изображением
|
||||
через `pointerInput` + `graphicsLayer`; проверить Compose-тестом (Robolectric) на pinch и double-tap
|
||||
- [x] 1.3 Переключать источник на `originalUrl` при входе в зум, сохраняя cache key Coil; проверить,
|
||||
что запрос данных меняется при `zoomed` и не сбрасывает дисковый кэш
|
||||
|
||||
## 2. Viewer integration
|
||||
|
||||
- [x] 2.1 Поднять `zoomed` в `ViewerContent` и учитывать его в `pagerScrollEnabled`; проверить
|
||||
Robolectric-тестом «свайп не листает увеличенное фото»
|
||||
- [x] 2.2 Подключить zoomable-обёртку в ветку изображения `MediaPage`; проверить тестом, что при
|
||||
переходе на другой элемент и обратно изображение показывается во вписанном виде
|
||||
|
||||
## 3. Integration verification
|
||||
|
||||
- [x] 3.1 Прогнать `./gradlew test` и `./gradlew lintDebug`; на эмуляторе вручную проверить pinch,
|
||||
панорамирование, double-tap, предел 200%, а также что видео и панорама не затронуты
|
||||
|
||||
## Workflow follow-up
|
||||
|
||||
- Архив change после прохождения ревью проекта.
|
||||
Reference in New Issue
Block a user