Skip to content

Commit

Permalink
Be able to navigate to next page when rotate the device
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Rezaei committed Jun 8, 2018
1 parent 8ee13bf commit 85e347a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,21 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
moviesPresenter.setView(this);
if (savedInstanceState != null) {
movies = savedInstanceState.getParcelableArrayList(Constants.MOVIE);
adapter.notifyDataSetChanged();
moviesListing.setVisibility(View.VISIBLE);
} else {
moviesPresenter.setView(this);
moviesPresenter.firstPage();
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_sort:
moviesPresenter.setView(this);
moviesPresenter.firstPage();
displaySortingOptions();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class MoviesListingPresenterImpl implements MoviesListingPresenter {
@Override
public void setView(MoviesListingView view) {
this.view = view;
displayMovies();
}

@Override
Expand Down

0 comments on commit 85e347a

Please sign in to comment.