Created
May 27, 2018 17:16
-
-
Save bltuckerdevblog/b80839967c2f06f8809c75bd6d19f11c 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
class TeamsViewModel @Inject | |
constructor(private val teamDao: TeamDao) : ViewModel(){ | |
val liveTeamData: LiveData<PagedList<Team>> | |
init { | |
val teamsByNameDataSourceFactory = teamDao.loadTeamsByName() | |
val pagedListConfig = PagedList.Config.Builder() | |
.setEnablePlaceholders(true) | |
.setInitialLoadSizeHint(10) | |
.setPageSize(10) | |
.build() | |
liveTeamData = LivePagedListBuilder(teamsByNameDataSourceFactory, pagedListConfig).build() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment