Open goktugerce opened 8 years ago
In your ViewHolder
which implements ItemTouchHelperViewHolder
you need to override onItemSelected
and onItemClear
.
Start a scale animation in onItemSelected
and reverse in onItemClear
and you are done :)
I have been wondering if I can add a zoom animation to my items on RecyclerView. My item layout has only ImageView and I want to be able to enlarge image to its original size on touch and return it to its scaled size after touch ends. I have tried several stuff but could not manage to find a solution. It either blocks the dragging or does not go back to scaled size after I stop pressing.
If I add a touch listener with ACTION_DOWN and ACTION_UP cases, I can use a scale animation but can't move the item. If I do it in onMove method, it enlarges after the drag, not on touch and it doesn't shrink back. Any suggestion?