Skip to content

Instantly share code, notes, and snippets.

@manuelernesto
Created January 15, 2019 16:16
Show Gist options
  • Save manuelernesto/48498575fe8a8cca8484819d5bd8132e to your computer and use it in GitHub Desktop.
Save manuelernesto/48498575fe8a8cca8484819d5bd8132e to your computer and use it in GitHub Desktop.
class Holder(
itemView: View,
val people: List<Person>,
val context: Context) : RecyclerView.ViewHolder(itemView),
View.OnClickListener {
val name: TextView = itemView.findViewById(R.id.list_name)
val email: TextView = itemView.findViewById(R.id.list_email)
val phone: TextView = itemView.findViewById(R.id.list_phone)
init {itemView.setOnClickListener(this)}
override fun onClick(v: View?) {
val person = people[adapterPosition]
val intent = Intent(context, UpdateFirestoreActivity::class.java)
intent.putExtra("Person", person)
context.startActivity(intent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment