예제 #1
0
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   initGameRecyclerView();
   initFab();
   setPresenterView();
   gameListPresenter.onStart();
 }
예제 #2
0
  /**
   * Trying to restore games stored when lifecycle got stopped
   *
   * @param savedInstanceState
   */
  @Override
  public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
    super.onViewStateRestored(savedInstanceState);

    if (savedInstanceState != null) {
      Parcelable safeGamesLoadedParcel =
          savedInstanceState.getParcelable(EXTRA_CURRENT_GAMES_LOADED);
      List<Game> safeGamesLoaded = Parcels.unwrap(safeGamesLoadedParcel);
      gameListPresenter.updateViewWithSafeGames(safeGamesLoaded);
    }
  }
예제 #3
0
 @Override
 public void onItemClick(View view, Game game) {
   gameListPresenter.onGameClick(game, view.findViewById(R.id.gameItemImage));
 }
예제 #4
0
 @OnClick(R.id.fab)
 public void onFabClick() {
   gameListPresenter.refreshGames();
 }
예제 #5
0
 @Override
 public void onPause() {
   super.onPause();
   gameListPresenter.onPause();
 }
예제 #6
0
 @Override
 public void onResume() {
   super.onResume();
   gameListPresenter.onResume();
 }
예제 #7
0
 private void setPresenterView() {
   gameListPresenter.setView(this);
 }