Created
September 30, 2017 13:07
-
-
Save bltuckerdevblog/55531c00e4820eafee35de71b7cb8656 to your computer and use it in GitHub Desktop.
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
@Singleton | |
class TeamsViewModel @Inject | |
constructor(private val teamDao: TeamDao) : ViewModel(){ | |
val userListLiveData : LiveData<PagedList<Team>> | |
val tiledDataSource : TiledDataSource<Team> | |
init{ | |
val pagedListConfig = PagedList.Config.Builder() | |
.setPageSize(20) | |
.setPrefetchDistance(20) | |
.build() | |
userListLiveData = teamDao.getTeamsAsLivePagedListProvider().create(0, pagedListConfig) | |
tiledDataSource = teamDao.getTeamsAsTiledDataSource(100) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment