Skip to content

Instantly share code, notes, and snippets.

@fluxtah
Created January 20, 2020 15:33
Show Gist options
  • Save fluxtah/7557694c1574131a1e54df8f4e5cbfb1 to your computer and use it in GitHub Desktop.
Save fluxtah/7557694c1574131a1e54df8f4e5cbfb1 to your computer and use it in GitHub Desktop.
addRecyclerView(
view = { inflater, parent ->
inflater.inflate(R.layout.simple_carousel, parent, false)
},
data = PaginatedLiveData<String> {
hasMore = { loaded.size < 100 }
nextPage = {
delay(2000)
listOf("Hello")
}
},
itemViewHolder = { inflater, parent, _ ->
SimpleCarouselItemViewHolder(inflater, parent)
},
itemBinder = { holder, data:String? ->
holder.itemView.findViewById<TextView>(R.id.text).text = data
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment