What is Recyclerview on Android?

Asked

Viewed 1,724 times

1

What is the function of RecyclerView in an Android app?

1 answer

4


RecyclerView has come to replace both the ListView as to the GridView (including entities supporting both).

The RecyclerView is much more efficient than the two old implementations, even using a configuration of ViewHolder practically equal (we cannot define optimization only in the aspect of ViewHolder). One of the great advantages of it is the flexibility of being able to change from LayoutManager without having to implement a code truck only to have versions of Tiles or cards in our list.

As with ListView and GridView, the RecyclerView needs extra entities to be able to function, in case we have the LayoutManager (in the video I used the LinearLayoutManager) which is responsible for the redenration of View of each item on the device screen.

We have the Adapter which is responsible for linking the data of the set passed to it View (which will be the view of each item in the RecyclerView) and then send this View at the LayoutManager.

And finally, we have the ViewHolder which is responsible for the View's created in the method onCreateViewHolder() to later reuse them optimizing the work with the RecyclerView.

Video: http://www.thiengo.com.br/recyclerview-material-design-android-parte-2

  • I’ll edit the answer Holmes.

  • This material is from the link I put in the reply, thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.