Created
March 1, 2017 19:50
-
-
Save josedlpozo/19a4b0448765a50eecac7cee6ab3840c to your computer and use it in GitHub Desktop.
ListView interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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