Created
May 1, 2020 12:54
-
-
Save baggednismo/45d52ec5b0741fe5f0608c9905b86ddb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParentItemsAdapter(private val data: List<ParentItemModel>, | |
private var itemListener: ItemListener | |
) : RecyclerView.Adapter<ParentItemsViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ParentItemsViewHolder { | |
val inflater = LayoutInflater.from(parent.context) | |
return ParentItemsViewHolder( | |
inflater, | |
parent, | |
itemListener | |
) | |
} | |
override fun onBindViewHolder(holder: ParentItemsViewHolder, position: Int) { | |
val card: ParentItemModel = data[position] | |
holder.bind(card) | |
} | |
override fun getItemCount() = data.size | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment