Skip to content

Instantly share code, notes, and snippets.

@Sinarahimi
Created February 15, 2018 08:33
Show Gist options
  • Save Sinarahimi/ecc6634cf1b729d5aee3f7253c2ffbb8 to your computer and use it in GitHub Desktop.
Save Sinarahimi/ecc6634cf1b729d5aee3f7253c2ffbb8 to your computer and use it in GitHub Desktop.
...
HomeViewModel homeViewModel = ViewModelProviders.of(this).get(HomeViewModel.class);
homeViewModel.getMovies().observe(HomeActivity.this, movieList -> {
if (movieList != null) {
ArrayList<Movie> movieArrayList = new ArrayList<>(movieList);
homeAdapter = new HomeAdapter(HomeActivity.this, movieArrayList);
InfiniteScrollAdapter wrapper = InfiniteScrollAdapter.wrap(homeAdapter);
discreteScrollView.setAdapter(wrapper);
}
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment