nextcloud / news-android

📱🗞️ Android client for the Nextcloud news/feed reader app
https://play.google.com/store/apps/details?id=de.luhmer.owncloudnewsreader
GNU Affero General Public License v3.0
699 stars 257 forks source link

Add Pinch to zoom for images #1367

Open hamuchen opened 10 months ago

hamuchen commented 10 months ago

I read my feeds in this app, obviously. I read comics, but also in articles I sometime want to zoom in to see a detail or read small text in the image. Now I need to open the article in the browser, scroll to where I was, then zoom in. It would be awesome to zoom in right in this app.

Thanks and cheers hamu

David-Development commented 10 months ago

@hamuchen Thank you for the feedback.

A thought that comes to mind: If we allow zooming it would be counter intuitive with being able to scroll horizontally between articles. Imagine you are zooming in on something in the article and then you start scrolling horizontally because you want to go to the next article - you'd either have to scroll to the border of the article and trigger to get to the next page or zoom out completely. But then again.. it's the same awkward UX as e.g. WhatsApp has when you look at a bunch of pictures.

Should be fairly simple to implement - probably just need to adjust the following line: https://github.com/nextcloud/news-android/blob/cf83332d0601b2b5093e42be6e041d5b3394e8e0/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/async_tasks/RssItemToHtmlTask.java#L123

stefan-niedermann commented 10 months ago

Hm, maybe it's possible to detect starting a pinch to zoom gesture (two fingures) and disable horizontal swiping in this case? When ending the pinch gesture, reenable horizontal swiping.

I remember a similar issue in the Notes app (vertical scrolling vs. swipe horizontal to delete) which had a similar "fix"

hamuchen commented 10 months ago

Or you enable press / long press to open the image in a modal / fullscreen dialog where you can pinch to zoom?

kuba-orlik commented 8 months ago

@David-Development

A thought that comes to mind: If we allow zooming it would be counter intuitive with being able to scroll horizontally between articles. Imagine you are zooming in on something in the article and then you start scrolling horizontally because you want to go to the next article - you'd either have to scroll to the border of the article and trigger to get to the next page or zoom out completely.

I remember looong time ago an iOS app that worked like this: if you pan the image right to left, and pan it to the absolute max, then the panning stops and there's this "there's nothing more to the right" animation effect on the right edge of the screen. But if you release your finger and then start swiping from right to left, then the image gives way and you can see the next news item slide in from the right.

But @hamuchen's suggestion to just have the ability to open the image standalone in fullscreen mode sounds much simpler to use (and possibly to implement, as well :crossed_fingers: )