Пример #1
0
 public void cancelUpdate() {
   mNavigationImageView1.cancelUpdate();
   mNavigationImageView2.cancelUpdate();
   mNavigationImageView3.cancelUpdate();
   mNavigationImageView4.cancelUpdate();
 }
Пример #2
0
  public void setCurrentLevel(int position) {
    UserInfoManager cUserInfoManager = UserInfoManager.getInstance();
    if (position == 0) {
      mLevelView.setText(
          getResources().getString(R.string.current_level, cUserInfoManager.getCurrentPoint()));
    } else {
      mLevelView.setText(
          getResources()
              .getString(R.string.current_go_level, cUserInfoManager.getLevelDivByLevel(position)));
    }
    mLevel = position;
    boolean isLocked = false;

    if (cUserInfoManager.getCurrentLevel() >= position) {
      // unlocked
      if (position != 0) {
        mLevelView.setText(getResources().getString(R.string.current_unlocked_level, position));
      }
      // mCountView.setVisibility(VISIBLE);
      // mCountView.setText(Integer.toString(GirlLoader.getTotalImageCountOnServer(getContext(),
      // mLevel)));
      mMaskView.setVisibility(GONE);
    } else {
      isLocked = true;
      // mCountView.setVisibility(GONE);
      mMaskView.setVisibility(VISIBLE);
    }
    // setEnabled(!isLocked);
    mNavigationImageView1.setLocked(isLocked, position);
    mNavigationImageView2.setLocked(isLocked, position);
    mNavigationImageView3.setLocked(isLocked, position);
    mNavigationImageView4.setLocked(isLocked, position);

    mLocked = isLocked;
    if (isLocked) {
      int index = ImageResourceUtils.getLastNavigationIndex(getContext(), position);
      mNavigationImageView1.updateContext(false, index++);
      mNavigationImageView2.updateContext(false, index++);
      mNavigationImageView3.updateContext(false, index++);
      mNavigationImageView4.updateContext(false, index++);
    } else {
      mNavigationImageView1.updateContext(true, NavigationImageView.INVALID_INDEX);
      mNavigationImageView2.updateContext(true, NavigationImageView.INVALID_INDEX);
      mNavigationImageView3.updateContext(true, NavigationImageView.INVALID_INDEX);
      mNavigationImageView4.updateContext(true, NavigationImageView.INVALID_INDEX);
    }
  }