Skip to content

Instantly share code, notes, and snippets.

@josedlpozo
Created March 1, 2017 19:46
Show Gist options
  • Save josedlpozo/18b3325a84d9697e10120eaa88901d83 to your computer and use it in GitHub Desktop.
Save josedlpozo/18b3325a84d9697e10120eaa88901d83 to your computer and use it in GitHub Desktop.
'Kotlin mutante subjects interface'
interface SubjectsListView : LoadingView {
val adapter: Adapter<SubjectViewModel>
val ctx: Context
fun showSubjects(subjects: SubjectsViewModel) {
adapter.clearAll()
adapter.addAll(subjects)
adapter.notifyDataSetChanged()
}
fun showMoreSubjects(subjects: SubjectsViewModel) {
adapter.addAll(subjects)
adapter.notifyDataSetChanged()
}
fun goToSubjectDetail(subject: SubjectViewModel) {
SubjectDetailActivity.open(ctx, subject)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment