Example #1
0
  public static Avatar getAvatar() {
    Preconditions.checkState(!UserState.getInstance().isGuest());

    final String url = ConfigDao.get(ConfigDao.KEY_AVATAR, null);
    Preconditions.checkNotNull(url);

    return new Avatar.Builder().setBaseUrl(url).createAvatar();
  }
Example #2
0
  public static void checkDailyAward() {
    if (UserState.getInstance().isGuest()) {
      return;
    }

    boolean hasAward;
    try {
      hasAward = RequestHelper.hasDailyAward();
    } catch (ConnectionException | RemoteException | RequestException e) {
      LogUtils.v(TAG, "check daily award failed", e);
      return;
    }

    if (hasAward) {
      AppCtx.getEventBus().post(new BusEvent.DailyAwardEvent(true));
    }
  }