コード例 #1
0
  public void setLockPatternType(LockPatternType lockPatternType) {
    this.lockPatternType = lockPatternType;
    if (lockPatternType == LockPatternType.VERIFY_CAPTCHA) {
      final ArrayList<LockPatternView.Cell> pattern;
      if (getIntent().hasExtra(EXTRA_PATTERN)) {
        pattern = getIntent().getParcelableArrayListExtra(EXTRA_PATTERN);
      } else {
        getIntent()
            .putParcelableArrayListExtra(
                EXTRA_PATTERN, pattern = LockPatternUtils.genCaptchaPattern(captchaWiredDots));
      }

      lockPatternView.setPattern(LockPatternView.DisplayMode.Animate, pattern);
    }
  }
コード例 #2
0
  protected final void init(LockPatternView lockPatternView) {
    this.lockPatternView = lockPatternView;
    initLockPatternType();
    initSettings();
    initLockPatternView();
    if (lockPatternType == LockPatternType.VERIFY_CAPTCHA) {
      final ArrayList<LockPatternView.Cell> pattern;
      if (getIntent().hasExtra(EXTRA_PATTERN)) {
        pattern = getIntent().getParcelableArrayListExtra(EXTRA_PATTERN);
      } else {
        getIntent()
            .putParcelableArrayListExtra(
                EXTRA_PATTERN, pattern = LockPatternUtils.genCaptchaPattern(captchaWiredDots));
      }

      lockPatternView.setPattern(LockPatternView.DisplayMode.Animate, pattern);
    }
    onInit(lockPatternType);
  }