Nikola Protrka CHALLENGES AND Kristijan Marić ASPECTS OF ...
Infinum Android Talks #18 - Create fun lists by Ivan Marić
Transcript of Infinum Android Talks #18 - Create fun lists by Ivan Marić
RECYCLER VIEW
Replaces ListView and GridView
Force usage of ViewHolder pattern
More work for a developer
http://stackoverflow.com/questions/3928193/how-to-animate-addition-or-removal-of-android-listview-rows
HOW ANIMATION WORKS
RecyclerView.ItemAnimator
DefaultItemAnimator
animateAppearance() → notifyItemInserted(int)
animateChange() → notifyItemChanged(int)
animateDisappearance() → notifyItemRemoved(int)
animatePersistence() → notifyItemMoved(int, int)
RecyclerView.ItemAnimator RecyclerView.Adapter
https://github.com/wasabeef/recyclerview-animators
BEFORE YOU START TO CODE
21 Animators
5 Adapters
3000+ stars
PREPARE HOLDER FOR ANIMATION
Initialize view properties before animation start
When saving for run pending
ALWAYS CALL DISPATCH END
dispatchMoveFinished
dispatchAddFinished
dispatchRemoveFinished
dispatchChangeFinished
DECORATOR ANIMATIONS
Dividers draw over the items
Animate in the ItemDecoration
Move decoration into the view
PREDICTIVE ANIMATIONS
Animate holder currently not visible
Could cause problems with multiple view types
Option to turn off
Any questions? [email protected] IVAN MARIĆ
Visit infinum.co or find us on social networks:
infinum.co infinumco infinumco infinum