thunder-app / thunder

Thunder - An open-source cross-platform Lemmy client for iOS and Android built with Flutter
https://thunderapp.dev
GNU Affero General Public License v3.0
732 stars 62 forks source link

Add option for full screen swipe-to-go-back #312

Open sageDieu opened 10 months ago

sageDieu commented 10 months ago

Is your feature request related to a problem? Please describe. I tend to prefer swipe actions for navigation, and in Apollo and other similar apps I'm usually able to turn on an option to swipe anywhere on the page to go back to the previous.

Describe the solution you'd like For a quick example check out the HackerNews app HACK: https://apps.apple.com/us/app/hack-for-hacker-news-reader/id1464477788

Enable the setting for "full screen swipe to go back" and then go load a post and swipe anywhere on the screen to go back to the list of posts.

micahmo commented 10 months ago

Related to #198.

jordan1776 commented 10 months ago

Personally I would rather have partial screen swipe to go back rather than full screen so you could both have comment gestures and swipe back at the same time. This type of action is already used for the side menu on the feed view.

micahmo commented 10 months ago

you could both have comment gestures and swipe back at the same time

One idea: Relay uses right-to-left for back and left-to-right for post/comment gestures.

thepaperpilot commented 10 months ago

As another relay user, I'd also like to be able to swipe right to go back. Now that the swipe gestures are customizable, I'd love to have something that just entirely disabled swiping right on comments to allow going back instead

jordan1776 commented 10 months ago

, I'd love to have something that just entirely disabled swiping right on comments to allow going back instead

Maybe the swipe settings should have up to 4 on the right side for emulating Relay and 2 on the left for Apollo, with the option to set the 2nd, 3rd, and 4th actions to none. And if both left side actions are set to none, use the full screen swipe.

Fmstrat commented 10 months ago

This needs to be considered for iOS vs Android. Newer versions of Android have a default swipe back action. iOS will probably steal this in the future, but for now, if this is implemented it may need to be platform specific.

hjiangsu commented 10 months ago

For swiping right to go back, iOS already has that natively (I can swipe right from any screen to go to the previous screen) I didn't fully realize that this was not the case for Android (I'm guessing it depends on the OS version or variant)

The one thing I'm wondering about with the full screen swipe is how it interferes with swipe gestures. Would swipe gestures on comments/posts need to be turned off for this to work or is there a way that both of them can work together?

micahmo commented 10 months ago

is there a way that both of them can work together?

Not saying this is the best answer, but one thing we discussed in this thread is having left-to-right go back and right-to-left for gestures. We might want up to four gestures per side in that case though.

CTalvio commented 10 months ago

For swiping right to go back, iOS already has that natively (I can swipe right from any screen to go to the previous screen) I didn't fully realize that this was not the case for Android (I'm guessing it depends on the OS version or variant)

The one thing I'm wondering about with the full screen swipe is how it interferes with swipe gestures. Would swipe gestures on comments/posts need to be turned off for this to work or is there a way that both of them can work together?

Newer android versions do support system gestures as well, though some user have stuck with old three softbutton navbar, and some phone brands do not use gesture navigation by default.

The screen edge back gesture is different from the full screen gesture used by relay, and obviously cannot be used if you've not enabled the new gesture navbar.

hjiangsu commented 9 months ago

This has been implemented (without the toggle) in the latest pre-release. Let me know your thoughts!

If there is a left-to-right action, then full page swipe is disabled and you can only go back when swiping from the left. Otherwise, it should be enabled

thepaperpilot commented 9 months ago

It's great to see it coming along! I've personally found it really hard to swipe precisely enough to get it to work, though. Could it be more forgiving about the exact angle? For example, give 45 degree leeway either direction.

hjiangsu commented 9 months ago

Do you have any left-to-right gestures enabled? If you do, then swiping back will only get triggered from the edge of the screen

You can try these settings and let me know if you're still having trouble!

image

micahmo commented 9 months ago

I've personally found it really hard to swipe precisely enough to get it to work, though.

@hjiangsu Yeah, unfortunately after daily driving this on my physical device, I'm finding it's a bit inconsistent as well. I can't tell if it's not recognizing the gesture or getting totally disabled sometimes, but it was weird. Maybe needs some more tweaking.

hjiangsu commented 9 months ago

Dang okay, maybe we need to refine this a bit more somehow then. Maybe just list out some of the screens that you're experiencing this on, and how you're performing the swipe gesture and we can narrow it down

micahmo commented 9 months ago

If I get a chance alter I'll try to do a screen recording with touches on so you can see what's happening.

micahmo commented 9 months ago

@hjiangsu GitHub is having trouble playing the recording from my physical device (probably a format issue), so I DM'd you in Matrix.

micahmo commented 8 months ago

This has been added to the latest general release. However, the functionality seems to be a bit hit-or-miss on Android. While this is still being investigated I'll leave this issue open.

micahmo commented 8 months ago

Just circling back on this issue... I happened to notice that swiping back on the center FAB is very consistent! This leads me to believe our original conclusion was correct that there is still some conflict of gestures with the comments (Dismissible).