Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swipe to delete gesture is way to sensitive #663

Closed
paskalito opened this issue Jan 5, 2020 · 11 comments
Closed

swipe to delete gesture is way to sensitive #663

paskalito opened this issue Jan 5, 2020 · 11 comments

Comments

@paskalito
Copy link

im on a Galaxy S4 LOS Android 7

And i constantly delete notes in normal operation because the gesture is so sensitive.

I would argue that something like almost half of display with or a third of it should be actively swiped (with finger on the display) before "release animation" gets triggered / file deleted.

just for the fun:
it got much worse since #661 AND this nextcloud/server#13160 affects me ^^

@stefan-niedermann
Copy link
Member

Sure, we are using ItemTouchHelper.onSwiped() for a consistent UX in android. So we let the framework decide how long one does need to swipe to recognize it as an actual swipe.

I did not see any configuration options (Like Toast.LENGTH_SHORT / TOAST.LENGTH_LONG), so it ended up being the default.

For me personally it always worked great and i deleted an note accidentally maybe once (which was no problem because of undo).

Maybe you have an idea how to optimize this behavior without introducing 400 lines of extra code? A PR would be very welcome :)

@stefan-niedermann
Copy link
Member

The current length depends not only on the actual dragged width but also on the speed and seems to be identical with deleting emails in Mail apps, SMS apps etc.

@paskalito
Copy link
Author

thanks for your replies!
unfortunately i don't know anything about android dev..

TRIM_20200106_164600.mp4.zip

i made a video dough (with "touchpoint" enabled) to see how super sensitive it is on my device.

i don't have other apps that use this functionality besides conversations (where it is a lot less sensitive - maybe it is possible to look at that code) and opentasks (where it is actually to hard to swipe something away in my opinion)

@paskalito
Copy link
Author

https://github.com/siacs/Conversations/search?q=ItemTouchHelper.onSwiped%28%29&unscoped_q=ItemTouchHelper.onSwiped%28%29

conversations seems to import it it at least from a diffrent place

@paskalito
Copy link
Author

getSwipeThreshold – Here we return the float value. example 0.5f means that a 50 percent swipe on the RecyclerView row would be considered as a swipe.

from here: https://www.journaldev.com/23164/android-recyclerview-swipe-to-delete-undo

@stefan-niedermann
Copy link
Member

https://www.journaldev.com/23164/android-recyclerview-swipe-to-delete-undo

Now this looks interesting! I will investigate this, this might be a solution, indeed!

@stefan-niedermann
Copy link
Member

Okay, the swipe threshold only counts, if one drags lets say 50%, the stop and then release the finger from the display.

But as far as i can tell after trying this, it does not affect the width, if the finger is released from the display within the dragging-movement.

@stefan-niedermann
Copy link
Member

I am currently looking at the getSwipeEscapeVelocity method, which is also overridden by conversations.

@stefan-niedermann
Copy link
Member

Okay, that's it. I trippled the defaultValue and it is now way harder to delete a note accidently.

Maybe one of you can check the current master branch (or wait until 2.4.2 has been build by F-Droid) and give some feedback here?

Just for reference: https://stackoverflow.com/a/53514523

@stefan-niedermann
Copy link
Member

cc @kzar79 check out the last comment, feedback is welcome :)

@paskalito
Copy link
Author

  1. Thanks a lot ! :)
  2. regarding the checking master branch - i don't now how to compile an android app - and i didn't find build instructions in the repo. (but this maybe commn knowledge for android developers)
  3. i checked in like every version i am running 2.4.8 now. And i don't know if i can trust my senses but for me it seems like there is nothing/not much changed.. also if i check with my video a tiny gesture slightly to the left still deletes the note...

but i fail in understanding what gesture exactly triggers the motion..
maybe try to multiply the value by 10 ?

in conversations i just checked again you activly/willingly must drag the conversation for about 40% of your display to delete it (and if you swipe out of the element while dragging (in a vertical axis) it still will delete it if you drag it enough in the horiziontal axis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants