daimajia / AndroidSwipeLayout

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

swipe on some rows #255

Open dhrumit opened 8 years ago

dhrumit commented 8 years ago

How to apply swipe on some rows based on condition in recylerview? Is it possible to use multiple view holders for different type of items in recyclerview adapter where only single view holder contains swipe layout in row item and other view holders having simple row item without swipe layout.

viny76 commented 8 years ago
    if (condition on cell) {
        swipeLayout.setRightSwipeEnabled(false);
        swipeLayout.setLeftSwipeEnabled(false);
    } else {
        swipeLayout.setRightSwipeEnabled(true);
        swipeLayout.setLeftSwipeEnabled(true);
    }