Skip to content

Instantly share code, notes, and snippets.

@adamsp
Created October 10, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamsp/417d362d036887c5bd46efdecba5b2dc to your computer and use it in GitHub Desktop.
Save adamsp/417d362d036887c5bd46efdecba5b2dc to your computer and use it in GitHub Desktop.
Paging Lib Blog PagedList.kt
val mainHandler = Handler(Looper.getMainLooper())
val pagedList = PagedList.Builder<Int, Screenshot>()
.setDataSource(dataSource)
.setMainThreadExecutor({ mainHandler.post(it) })
.setBackgroundThreadExecutor(diskExecutor)
.setConfig(PagedList.Config.Builder()
.setPageSize(8)
.setEnablePlaceholders(true)
.build())
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment