Skip to content

Instantly share code, notes, and snippets.

@josedlpozo
Created March 1, 2017 19:50
Show Gist options
  • Save josedlpozo/19a4b0448765a50eecac7cee6ab3840c to your computer and use it in GitHub Desktop.
Save josedlpozo/19a4b0448765a50eecac7cee6ab3840c to your computer and use it in GitHub Desktop.
ListView interface
interface ListView<T> : LoadingView {
val adapter: Adapter<in T>
fun showItems(items: Iterable<T>) {
adapter.clearAll()
adapter.addAll(items)
adapter.notifyDataSetChanged()
}
fun showMoreItems(items: Iterable<T>) {
adapter.addAll(items)
adapter.notifyDataSetChanged()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment