Skip to content

Instantly share code, notes, and snippets.

@AdiD253
Last active December 27, 2018 10:01
Show Gist options
  • Save AdiD253/846581cd7ceb39f656bb054b5ebc6013 to your computer and use it in GitHub Desktop.
Save AdiD253/846581cd7ceb39f656bb054b5ebc6013 to your computer and use it in GitHub Desktop.
class SampleAdapter : RecyclerView.Adapter<SampleViewHolder>() {
private var itemList: List<SampleItem> by Delegates.observable(initialValue = listOf(), onChange = { property, oldValue, newValue ->
autoNotify(oldValue, newValue)
})
fun setItems(itemList: List<SampleItem>) {
this.itemList = itemList
}
(...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment