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 94 forks source link

Draw BG item animator #1

Open recoverrelax opened 8 years ago

recoverrelax commented 8 years ago

The itemanimator that draw the BG will also work for added itens. For some reason. Any workaround?

felixaa commented 8 years ago

I'm having the exact same issue..

felixaa commented 8 years ago

I just removed the background draw methods from onDraw() in setUpAnimationDecoratorHelper()

avluis commented 8 years ago

You can try moving and enclosing the draw calls in a conditional statement like so:

if (isCurrentlyActive && actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
    background.draw(c);
    clearDrawable.draw(c);
}

Let me know how that works out for you.

AkshayPathak commented 8 years ago

Just tried this but the background seems to blink when being used. Not exactly sure whats causing it.