Skip to content

Instantly share code, notes, and snippets.

@bangiqi
Created June 15, 2018 17:28
Show Gist options
  • Save bangiqi/74713620cfbc721f0c51f797640cedb3 to your computer and use it in GitHub Desktop.
Save bangiqi/74713620cfbc721f0c51f797640cedb3 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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment