Skip to content

Instantly share code, notes, and snippets.

@the-dagger
Last active December 30, 2017 17:10
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 the-dagger/19ad39316c531f5ee13e05a96a192ce3 to your computer and use it in GitHub Desktop.
Save the-dagger/19ad39316c531f5ee13e05a96a192ce3 to your computer and use it in GitHub Desktop.
fun bind(student: Student) {
with(student) {
studentName.text = name //the property in Student called directly instead of calling student.name or student.getName()
studentSubject.text = subject
Picasso.with(itemView.context).load(image).into(studentImage)
}
itemView.setOnClickListener { Toast.makeText(itemView.context, "Student's name : " + student.name, Toast.LENGTH_SHORT).show() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment