Skip to content

Instantly share code, notes, and snippets.

@bangiqi
Last active June 15, 2018 16:18
Show Gist options
  • Save bangiqi/a164ab8e801159cfbcca9439aabaa055 to your computer and use it in GitHub Desktop.
Save bangiqi/a164ab8e801159cfbcca9439aabaa055 to your computer and use it in GitHub Desktop.
class BulanHijriyahAdapter(val items: ArrayList<String>, val context: Context) : RecyclerView.Adapter<ViewHolder>() {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder?.tvNamaBulanHijriyah?.text = items.get(position)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(context).inflate(R.layout.bulan_hijriyah_list_item, parent, false))
}
override fun getItemCount(): Int {
return items.size
}
}
class ViewHolder (view: View) : RecyclerView.ViewHolder(view){
val tvNamaBulanHijriyah = view.tv_nama_blnhijriah
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment