I am using recyclerview 22.2.0 and the helper class ItemTouchHelper.SimpleCallback to enable swipe-to-dismiss option to my list. But as I have a type of header on it, I
If someone is using ItemTouchHelper.Callback. Then You can remove any related flags in getMovementFlags(..) function.
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
return makeMovementFlags(dragFlags, swipeFlags);
}
Here instead of dragFlags and swipeFlags You can pass 0 to disable corresponding feature.
ItemTouchHelper.START means swiping left to right in case of left to right locale (LTR application Support), but the other way around in a right to left locale (RTL application Support).
ItemTouchHelper.END means swiping in the opposite direction of START
.
so you can remove any flag according to your requirements.