-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
To debate : Swipe mechanism improvements #905
Comments
Looks like option A is pretty straightforward to implement (see https://stackoverflow.com/questions/51089275/swipe-delete-on-recycleview-is-very-sensitive) I'll submit a PR about that one |
Swipe customization (in response to #905)
So I've been thinking about what you said about creating a separate specialized class for option B... and it looks like there are two different ways to acheive the desired result : Option B1- Let the user display what he wants (buttons, images, icons...) under the item, using the same sub-layer as he's using with the current implementation. I think that option can be acheived with minor additions to the current implementation and won't necessarily need to be "isolated" in a 2nd class. It also leaves the user with more flexibility, as he has total control on what he puts in the sub-layer Option B2 - Draw buttons on the same layer as the item, in the empty space created where the item has been swiped away. This one will probably require a separate class to be properly readable. It will also need a couple options to customize the drawn buttons (text, background color, text orientation and color, click handler....) I personally would like to go with Option B1, but you're the boss around, so I'd like to have your opinion as well :) |
reading through it and thinking more also makes me tend towards "Option B1" |
Alright, so I've been trying to implement B1 with encouraging results. It looks like you were right all along : the code and the API will become a big mess if we don't separate the new behaviour (let's call it "drawer swipe") from the current behaviour (let's call it "delayed swipe"). Notable differences are :
This makes it quite obvious both behaviours can't be implemented with the same components unless you aim at creating an incomprehensible API. With that in mind, I'd like to validate a few architecture choices with you : Library side
Sample app side
Once again, thanks in advance for your feeback 😁 |
Thanks for spending so much time into that and coming back with such a detailed report :) So for the library side. I would suggest to keep the original name to ensure retrocompatiblity. That will allow us to have this new feature in a minor update and won't require a major one due to breaking features. we could add a type alias though to have it also in the new proposed (more clear name) In regards to the sample app. I am actually fine with both behaviors, what works best for you / means the least amount of work for you. I suppose having it as a new entry in the drawer will give it more visibility which it should get :) Once again, thank you so much for the work! it's really amazing to see new improvements making their way into the lib :) |
I've been using FastAdapter to implement swipe to delete on my app as your sample app does :
The way it works upsets the clumsiest part of my users (and they're a bunch, apparently) who complain that they've been deleting stuff unintentionally. I've now given up on understanding how it can even be possible and am trying to find a better implementation.
After a couple discussions, we found two interesting improvements on which I would like your opinion :
A/ Make swipe less sensitive (i.e. no sling; you have to intentionally swipe on all screen width to trigger the action)
and/or
B/ Implement a partial swipe
What I would love FastAdapter to do is a "partial swipe" where the swiped item card can go as far as a given distance to the left / right, and not disappear completely, so that the user can have the choice between :
It's the behaviour of the "watch for later" screen of the Youtube app that you can see in action below
Any thoughts about both of these suggestions ? 😁
The text was updated successfully, but these errors were encountered: