Chapter 15. Recycler Views: Reduce, Reuse, Recycle
Lists of data are a key part of most apps.
And in this chapter, weâll show you how to create one using a recycler view: a super-flexible way of building a scrollable list. Youâll learn how to create flexible layouts for your list, including text views, checkboxes, and more. Youâll find out how to create adapters that squish your data into the recycler view in whatever way you choose. Youâll discover how to use card views to give your data a 3D material look. Finally, weâll show you how layout managers can completely change the look of your list with just one or two lines of code. Letâs get recyclingâ¦
What the Tasks app currently looks like
In the previous chapter, we built a Tasks app that lets the user enter task records into a Room database. The app displays the list of records as a formatted String
, and it looks like this:
We decided to display the task records using a formatted String
since it was a relatively quick and basic way of seeing the records that have been added to the database.
The list, however, looks a little bland. So how can we improve it?
We can turn the list into a recycler view
Instead of displaying the list of tasks as a formatted String
, we can change it up so that it looks like this: ...
Get Head First Android Development, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.