Skip to Main Content
Android Programming with Kotlin for Beginners
book

Android Programming with Kotlin for Beginners

by John Horton
April 2019
Beginner to intermediate content levelBeginner to intermediate
698 pages
15h 15m
English
Packt Publishing
Content preview from Android Programming with Kotlin for Beginners

RecyclerView and RecyclerAdapter

In Chapter 5, Beautiful Layouts with CardView and ScrollView, we used a ScrollView widget and we populated it with a few CardView widgets so that we could see it scrolling. We could take what we have just learned about ArrayList and create a container of TextView objects, use them to populate a ScrollView widget, and, within each TextView, place the title of a note. This sounds like a perfect solution for showing each note so that it is clickable in the Note to self app.

We could create the TextView objects dynamically in Kotlin code, set their text property to be the title of a note, and then add the TextView objects to a LinearLayout contained in ScrollView. But this is imperfect.

The problem with displaying lots ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Android with Kotlin

Programming Android with Kotlin

Pierre-Olivier Laurence, Amanda Hinchman-Dominguez, Mike Dunn, G. Blake Meike
How to Build Android Apps with Kotlin - Second Edition

How to Build Android Apps with Kotlin - Second Edition

Alex Forrester, Eran Boudjnah, Alexandru Dumbravan, Jomar Tigcal
Java to Kotlin

Java to Kotlin

Duncan McGregor, Nat Pryce

Publisher Resources

ISBN: 9781789615401Supplemental Content