Tech tip of this week

Android L: RecyclerView tutorial

RecyclerView is the new UI widget available in Android L Preview support library.

  • It is more advanced and flexible version of ListView
  • This widget is a container for large sets of views that can be recycled and scrolled very efficiently
  • It enforces the implementation of ViewHolder pattern
  • RecyclerView includes a new kind of adapter RecyclerView.Adapter class.

To use RecyclerView, you have to use

  • RecyclerView.Adapter : To create an adapter, you extend the RecyclerView.Adapter class
  • LayoutManager : Recycling views in this manner improves performance by avoiding the creation of unnecessary views or performing expensive findViewById lookups
  • ItemAnimator: Animates items when they are added, removed or reordered
  • ItemDecoration: Draws decorations around or on top of each item’s view

No comments:

Post a Comment