![]() Now that we have created the Model and the item layout, it is time to create our adapter class. The same is not going to be rendered when the application is run. I have used the “ tools:Text” attribute to find out how my layout will look in the designer. ![]() Create a class FootballTeam.java and create variable for Name, League and YearEstablished.įor this example, I have directly hardcoded the padding and textSize in the XML, but it is always a good idea to have the same in a separate XML file. We will create a model class for storing the info. We will display Football Team related information in the Recycler view.The XML file should look like below after the change:įor the Recycler view, we have provided an id and specified the scrollbars to be vertical. Open activity_main.xml in the layout folder and add the Recycler View widget. ![]() Click sync now to sync the changes and build the project. Open adle(Module:app) file and add the following “implementation ‘ :recyclerview-v7:26.1.0’” in the dependencies section.
0 Comments
Leave a Reply. |