They are great for small data sets but not for large. Previously ListViews were and gridviews were the only inbuilt alternatives. Android Engineers introduced RecyclerViews to provide a more efficient way of displaying large data sets. The end result is smoothness even with large datasets that we and our users can take for granted. So RecyclerView is great in this regard as instead of re-inflating the views, it holds them in a ViewHolder class and then recycles them, only binding fresh data to them. And you can imagine having hundreds of rows or grids of data. And remember this is to be done in realtime as the user scrolls through a list of data. Infation of views is normally expensive as it involves parsing of XML layouts into java objects. AdapterViews normally display collections of data.Įven though there have been various great and popular adapterviews like ListViews, GridViews and expandablelistviews, recyclerview is the best when it comes to displaying large quantities of data.Īnd that’s because of it’s concept of recycling already used views instead of re-inflating them everytime. RecyclerView is meant to work as an adapterview, basically with an adapter that adapts data to the RecyclerView’s views. Be it TextViews, Buttons, checkBoxes etc. RecyclerViews are not limited to any one particular view. And those views are just pieces of grahpical user interface widgets that normally we define in XML and get inflated in java. ListView as you may already know is also an adapterview and allows us display items in a vertically scrolling list. RecyclerViews were introduced in Android API 5 as an alternative to ListViews. A RecyclerView is an adapterview that allows us display a large data set through just a limited window.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |