I am implementing Swipe and Drag in RecyclerView
through the help of this article. On removing the item I want to show a SnackBar
but showing SnackBar
needs View. I don't know how to get View
inside the function of a RecyclerAdapter
.
My Code:
public void onItemDismiss(int position) {
notes.remove(position);
notifyItemRemoved(position);
/* Show SnackBar */
}
Edit: My question is different from this question. I am not having any problem in implementing SwipetoDismiss.I have successfully implemented it. But I want to show a SnackBar so that user can be notfied and Undo. I am having problem in showing SnackBar not in implementing onSwiped().