So far all the tutorials I've seen online are about animating RecyclerView
items on add/delete, but not the buttons/views inside the item itself.
The effect I'm going for is this: I click a button to download some content, and when it completes without errors, the button should slide out (or fade out or just move in any way) so that the user can't interact with it anymore.
Sample card inside a RecyclerView:
--------------------------
| Some content |
| |
| [Preview] [Download] | // <-- The Download button should go away,
-------------------------- // leaving the Preview button in the middle
I've tried android:animateLayoutChanges="true"
in the item layout xml but it had no effect after setting the download button's visibility to View.GONE
. In another attempt, I called viewHolder.button.animate().x(some_number)
in the adapter, but it did nothing as well. Am I missing something? Or is there no easy way of going about this simple animation?
Please guide me.