recyclerviewhelper
recyclerviewhelper copied to clipboard
Allow swipe to dismiss to be cancelled from within the adapter
I have a view in the recyclerview that I'd like to be undismissable. While I'd prefer that I have an option to disable swipe to dismiss for particular views, I'd be okay with the swiped-away view bouncing back in if onItemDismiss
returns false.
Currently onItemDismiss
does not return anything. Maybe it could be made to return a boolean like onItemMove
to indicate if the view should be dismissed or not.
Hey, I know this is kinda late but for those who still need it just add notifyItemChanged(position);
in onItemDismiss
without deleting the element from your collection .