From the course: Android Development Essential Training: Manage Data with Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a RecyclerView item layout

Create a RecyclerView item layout

From the course: Android Development Essential Training: Manage Data with Kotlin

Start my 1-month free trial

Create a RecyclerView item layout

- You need at least two layout files to display data in a recycler view. The primary layout that contains the recycler view itself, and a secondary layout. That defines the appearance of each data item. In this case of each tile within a grid. I'll create a new layout file in the layout directory under resources, and I'll name it "Monster Grid Item". Don't worry about the root element because I'm going to provide the finish code for this file. In a gist. I'll go to a browser and i'll navigate to Http://git.io/fjrzl all lowercase, and that expands to this bit of code. I'll click the raw button, then select all and copy. Then I'll come back to Android Studio. Select all and delete, and past the code into place. Here's what this tile layout looks like. It has a text view at the top. An image in the middle and something called a rating bar at the bottom. I'm going to use the rating bar widget to show the scariness level of each monster. Here's what the code looks like. The constraint…

Contents