daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

Left and Right swiping #423

Open TeodorKolev opened 7 years ago

TeodorKolev commented 7 years ago

Is there any option for left and right swiping at same time like this example? If there is how can I achieve that?

yanrubi commented 7 years ago

My way of doing it is by adding one more layout before the top one. And add one more swipeLayout.addDrag in the adapter. Then I use something like the following which is the current view so that I could define corresponding actions.

if (swipeLayout.getCurrentBottomView().getId() == R.id.bottom_wrapper_left) {
    // Current view with id R.id.bottom_wrapper_left
} else {
   // Current view with id R.id.bottom_wrapper_right
}

This link might be helpful too. http://android-pratap.blogspot.in/2015/07/swipe-recyclerview-using.html

rajat028 commented 6 years ago

Hi, I already implemented this with the same approach, but the problem is whenever I swipe left, and then right I have to touch the card again. What if I hold the cell once, and able to move freely in both directions. It would be great if you help me out with this approach