When I try to swipe-to-dismiss an item in the RecyclerView, the item decoration line remains on the screen (it can be seen on the gif animation I provide: http://imgur.com/v1D149C).
So, when I try to swipe out the recyclerView item, an alert dialog shows a message asking if I want to delete the item or not. As long as I click "OK", items remove normally. But if I click "Cancel", something weird happens, and after that whenever I delete any item in the list, some gap with item decoration line remains on the screen and I don't know what to do with it. I hope someone can help or at least say where to look for the solution, because I'm completely messed up.
I've used this RecyclerView Swipe-to-Dosmiss TouchListener: https://github.com/krossovochkin/Android-SwipeToDismiss-RecyclerView/blob/master/app/src/main/java/com/example/android/swipedismiss/SwipeDismissRecyclerViewTouchListener.java
Here is the code that I use in my app: http://pastebin.com/pkiLBRzr
The changes are in the private boolean handleTouchEvent(MotionEvent motionEvent)
method between 172 and 280 line (in the case MotionEvent.ACTION_UP:
).
Also, I use this as an ItemDecoration: https://gist.github.com/polbins/e37206fbc444207c0e92
And here is my MainActivity: http://pastebin.com/AUdLCHjs