‫Welcome back!
‫We created this custom item layout that contains one image view and one text view.
‫Now we need to create our data class or our model class.
‫Create a new Kotlin class, select data class and here I'll name it as Sport Model.
‫Select data Class and here we go.
‫This is our data class.
‫In Kotlin, a data class is a concise way to create classes whose primary purpose is to hold data.
‫Data classes automatically generate useful methods such as equals, hashCode, toString, and copy methods
‫based on the properties declared in the primary constructor.
‫And back to our card item layout.
‫We have two properties the image view that represents an integer, and the text view that represents
‫a string.
‫So here in the primary constructor of the data class, I need to declare two properties one of type
‫int that represents an image view and one that represents the text view of type string val image card.
‫It's of type int and val text.
‫It's of type string.
‫And to be specific I can use sports image.
‫And here I can be more specific.
‫Sport name the first property used to store an integer value representing the image associated with
‫the card.
‫In the recycler view it could be a resource identifier such as are drawable some image, for example
‫football pointing to the image resource in the project.
‫The second property holds a string value representing some text associated with the sport card, and
‫it will be the sport name.
‫Overall data.
‫Classes in Kotlin provide a concise and effective way to define and manipulate date classes that are
‫primarily used for holding data.