Skip to content

Instantly share code, notes, and snippets.

@husaynhakeem
Last active September 27, 2017 15:04
Show Gist options
  • Save husaynhakeem/70b6ee4f93f9ef4fe1d0100df719c482 to your computer and use it in GitHub Desktop.
Save husaynhakeem/70b6ee4f93f9ef4fe1d0100df719c482 to your computer and use it in GitHub Desktop.
public MainViewModel() {
PokemonDao pokemonDao = PokemonDataBase.getInstance(PokemonApplication.getContext()).pokemonDao();
pokemonList = pokemonDao.pokemons().create(INITIAL_LOAD_KEY, new PagedList.Config.Builder()
.setPageSize(PAGE_SIZE)
.setPrefetchDistance(PREFETCH_DISTANCE)
.setEnablePlaceholders(true)
.build()
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment