daimajia / AndroidSwipeLayout

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

Disable SwipeLayout on Some List Items #471

Open grndvl1 opened 7 years ago

grndvl1 commented 7 years ago

I have been toying with trying to disable the swipe container on certain list items. Setting View Gone in the onBindViewHolder on the first linearlayout does not work. Any way that there is a setting for this?

har2008preet commented 6 years ago

you can do this,

if (CONDITION_WHEN_SWIPE_DISABLE) {
            holder.swipeLayout.setSwipeEnabled(false);
        } else {
            holder.swipeLayout.setSwipeEnabled(true);
        }

before adding SwipeListener