Created
October 10, 2017 14:45
-
-
Save adamsp/417d362d036887c5bd46efdecba5b2dc to your computer and use it in GitHub Desktop.
Paging Lib Blog PagedList.kt
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
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