コード例 #1
0
 @Override
 public void requestControllerDidReceiveResponseSafe(final RequestController aRequestController) {
   final List<Game> featuredGames = _gamesController.getGames();
   if (featuredGames.size() > 0) {
     final ValueStore store = getScreenValues();
     final Game game = featuredGames.get(0);
     store.putValue(Constant.FEATURED_GAME, game);
     store.putValue(Constant.FEATURED_GAME_NAME, game.getName());
     store.putValue(Constant.FEATURED_GAME_PUBLISHER, game.getPublisherName());
     store.putValue(Constant.FEATURED_GAME_IMAGE_URL, game.getImageUrl());
     showControlIcon(R.drawable.sl_button_arrow);
   }
 }
コード例 #2
0
  @Override
  public void onCreate(final Bundle savedInstanceState) {
    // used in prepare dialog (must be restored before super.onCreate()
    _navigationIntent =
        getActivityArguments()
            .<NavigationIntent>getValue(Constant.NAVIGATION_INTENT, _navigationIntent);
    _navigationDialogContinuation =
        getActivityArguments().<Runnable>getValue(Constant.NAVIGATION_DIALOG_CONTINUATION);
    final Boolean navigationAllowed =
        getActivityArguments().<Boolean>getValue(Constant.NAVIGATION_ALLOWED, Boolean.TRUE);
    if (navigationAllowed != null) {
      _isNavigationAllowed = navigationAllowed;
    }

    super.onCreate(savedInstanceState);

    addObservedKeys(
        ValueStore.concatenateKeys(Constant.USER_VALUES, Constant.NUMBER_CHALLENGES_WON));

    _challenge =
        getActivityArguments().getValue(Constant.CHALLENGE, null); // assert challenge != null

    _opponentValueStore = new ValueStore();
    _opponentValueStore.putValue(Constant.USER, _challenge.getContender());
    _opponentValueStore.addObserver(Constant.NUMBER_CHALLENGES_WON, this);
    _opponentValueStore.addValueSources(new UserDetailsAgent(this));
    setNeedsRefresh();

    initAdapter();
  }