FlexibleAdapter icon indicating copy to clipboard operation
FlexibleAdapter copied to clipboard

Adding improved swipe capability

Open mikeKickserv opened this issue 7 years ago • 4 comments

I know swipe to dismiss is built into the library. Is there the capability to add swipable cells similar to this library? Currently I am using both libraries in my project and it would be great to have just one library. https://github.com/daimajia/AndroidSwipeLayout

mikeKickserv avatar Mar 09 '17 21:03 mikeKickserv

@mikeKickserv, thank you for your message! I will need to study that library to not reinvent it, as I just saw it is possible to include key classes in my code. Anyway, it will require big amount of time, which now I do not have. I will not put any milestone for this improvement.

If you want, you can start a new branch to merge the 2 libraries only for the RecyclerView. Then you can create a PR on it.

This is also a valid alternative: https://github.com/chthai64/SwipeRevealLayout

davideas avatar Mar 10 '17 09:03 davideas

Trying to implement the swipe with ViewDragHelper "hidden" helper.

Resources:

  • http://flavienlaurent.com/blog/2013/08/28/each-navigation-drawer-hides-a-viewdraghelper/
  • http://fedepaol.github.io/blog/2014/09/01/dragging-with-viewdraghelper/
  • https://github.com/fedepaol/dragqueen

PS. This has wide extensions! (Later Panels?)

davideas avatar Sep 11 '17 09:09 davideas

From a first analysis, it has a big implication on how the click listeners are set. Since the drag helper makes use of onInterceptTouchEvent() and onTouchEvent(), they might be coordinated in these 2 functions too.

davideas avatar Sep 11 '17 09:09 davideas

Unfortunately, I still don't find a good alternative to improve the swipe capability: the TouchListener seems to be the solution most used by others libraries, but here it will require a deep change for the existent click listeners in the ViewHolder and lot of time that now I can't dedicate.

The swipe-to-delete, however has been simplified a bit.

davideas avatar Oct 11 '17 23:10 davideas