The new class should have one property, textView, which should be initialized using findViewByIdĬlass TextItemViewHolder(view: View): RecyclerView.ViewHolder(view).The view will represent the layout in the item_layout.xml Create a new class TextItemViewHolder that has a view as a parameter and extends the RecyclerView.ViewHolder class.Create a new Kotlin file PresidentsAdapter.kt in the same folder as MainActivity: Right-click on package name in java/ -> New -> Kotlin class/file. It will create a dimen.xml file under values like below: If the is red in your file, Alt+Enter on the will help you allow the editor to "Create dimen value resource".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |