nemanja-kovacevic / recycler-view-swipe-to-delete

Sample project showing "swipe to delete" on a recycler view with no 3rd parties involved. It also include drawing on empty space while items are animating and an "undo" option
334 stars 96 forks source link

The drawable is rendered above the swiped view #3

Open bobymicroby opened 7 years ago

bobymicroby commented 7 years ago

When you swipe the xMark is shown above the row. If you release the swipe it still stays on top until you swipe another row.

screen shot 2016-08-26 at 12 13 28 pm
grarup commented 7 years ago

You can solve this by simply adding this around xMark.draw(c).

c.save();
c.clipRect(itemView.getRight() + (int) dX, itemView.getTop(), itemView.getRight(), itemView.getBottom());
xMark.draw(c);
c.restore();
JimVanG commented 7 years ago

My PR fixes this issue as well, without having to go through the draw process. https://github.com/nemanja-kovacevic/recycler-view-swipe-to-delete/pull/6