I have a RecyclerView with GridLayoutManager (support lib v7). I update adapter and make notifyItemMoved. If the item source position is on the screen and the destination position is on the screen as well - "move animation" is played. In case if the item was at position out of the screen(position 1000, or any other far from viewport) and moved into viewport it will appear with "fade in animation".
Looks like predictive item animations are not working despite on the fact supportsPredictiveItemAnimations() returns true. Am I doing something wrong? Should I override some methods to enable it?
I was reading the source code of RecyclerView, and in javadoc of the dispatchLayout method is written like:
- PERSISTENT views are moved ({@link ItemAnimator#animateMove(ViewHolder, int, int, int, int)})
- REMOVED views are removed ({@link ItemAnimator#animateRemove(ViewHolder)})
- ADDED views are added ({@link ItemAnimator#animateAdd(ViewHolder)})
- DISAPPEARING views are moved off screen
- APPEARING views are moved on screen
Nevertheless ItemAnimator doesn't distinguish ADDED and APPEARING. Is it possible fix predictife animations or at least make APPEARING animation look like "move from outside of the screen animation" lefting ADDED animation as is?