Skip to content

Instantly share code, notes, and snippets.

@mustafayigitt
Created March 26, 2020 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mustafayigitt/cd47e697d89b08c7f6ba761cd10e6765 to your computer and use it in GitHub Desktop.
Save mustafayigitt/cd47e697d89b08c7f6ba761cd10e6765 to your computer and use it in GitHub Desktop.
recyclerview adapter class
package com.mustafayigit.recyclerviewexample.ui.adapter
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.mustafayigit.recyclerviewexample.model.ProfileData
/**
* Created By MUSTAFA
* on 26/03/2020
*/
class ProfileDataAdapter(private val profileDataList: List<ProfileData>) :
RecyclerView.Adapter<ProfileDataViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProfileDataViewHolder = ProfileDataViewHolder(parent)
override fun getItemCount(): Int = profileDataList.size
override fun onBindViewHolder(holder: ProfileDataViewHolder, position: Int) = holder.bind(profileDataList[position])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment