ernestoyaquello / DragDropSwipeRecyclerview

Kotlin Android library that extends RecyclerView to support gestures like drag & drop and swipe, among others. It works with vertical, horizontal and grid lists.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable Swipe

khalil05400 opened this issue · comments

I want to disable swipe on some screen programmatically?unable to do this

// MEMO: Item. swiping setting
override fun canBeSwiped(item: Item, viewHolder: ViewHolder, position: Int): Boolean {
    return false
}

As @WORLD8848 has explained, you can disable swiping for each individual item overriding the adapter method canBeSwiped. Furthermore, if you want to disable swiping for just one direction, please check out the recycler view method called disableSwipeDirection.

You can find information about this and more in the readme file.