From the course: Building an Android App with Jetpack Libraries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add a RecyclerView to the main fragment - Android Tutorial
From the course: Building an Android App with Jetpack Libraries
Add a RecyclerView to the main fragment
- [Instructor] To display a list of data items, I'll use the RecyclerView component. This component can display data either in a list or in a grid. In this app, I'll only use its list capability. The documentation for the RecyclerView is here, and most importantly, you can find the most recent dependency. As of the time of this recording, we were working with RecyclerView 1.1.0. I'll select and copy that line, then I'll close this browser and return to Android Studio. I'll go to the build.gradle file for the app module, and I'll paste in that dependency right here and resync. Next, I'll open the layout file for the MainFragment. It's called main_fragment.xml and it starts off with just a single TextView object. In code view, I'll delete that TextView, then I'll go back to design view, and under the common section I'll find the RecyclerView here and I'll drag and drop it. Then I'll look at the code, and I'll see the…
Contents
-
-
-
-
Add a navigation controller to the activity5m 39s
-
(Locked)
Add a RecyclerView to the main fragment5m 30s
-
(Locked)
Create a custom layout for list rows3m 56s
-
(Locked)
Create a data entity class3m 57s
-
(Locked)
Create sample data for testing5m 27s
-
(Locked)
Create a RecyclerView adapter2m 42s
-
(Locked)
Bind data to the RecyclerView4m 58s
-
-
-
-
-
-