Skip to content

Instantly share code, notes, and snippets.

@tonnylitao
Last active June 17, 2020 09:49
Show Gist options
  • Select an option

  • Save tonnylitao/2a24ebeddc91a9d465f7040f9bb9b5b9 to your computer and use it in GitHub Desktop.

Select an option

Save tonnylitao/2a24ebeddc91a9d465f7040f9bb9b5b9 to your computer and use it in GitHub Desktop.
class RecyclerAdapter<M : RecyclerItem>(
diffCallback: DiffUtil.ItemCallback<M>,
@LayoutRes val placeholderId: Int?,
private val clickListener: Listener? = null
) : PagedListAdapter<M, ViewHolder<M>>
(diffCallback) {
...
typealias Listener<M>
= (RecyclerAdapter<M>, Int, M) -> Unit
typealias ViewHolder<M>
= RecyclerAdapter<M>.ViewHolder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment