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

Add a RecyclerView to the main fragment - Android Tutorial

From the course: Building an Android App with Jetpack Libraries

Start my 1-month free trial

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