@Override
  public void onClick(View v) {
    if (password == null) {
      password = "";
    }
    switch (v.getId()) {
      case R.id.fbv_0:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_0)).getText().toString();
        break;
      case R.id.fbv_1:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_1)).getText().toString();
        break;
      case R.id.fbv_2:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_2)).getText().toString();
        break;
      case R.id.fbv_3:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_3)).getText().toString();
        break;
      case R.id.fbv_4:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_4)).getText().toString();
        break;
      case R.id.fbv_5:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_5)).getText().toString();
        break;
      case R.id.fbv_6:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_6)).getText().toString();
        break;
      case R.id.fbv_7:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_7)).getText().toString();
        break;
      case R.id.fbv_8:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_8)).getText().toString();
        break;
      case R.id.fbv_9:
        password += ((TextView) mPasswordView.findViewById(R.id.tv_9)).getText().toString();
        break;
      case R.id.fbv_del:
        if (password.length() > 0) {
          password = password.substring(0, password.length() - 1);
        }
        break;
      default:
        break;
    }

    indicator.passwordChanged(password);
    mHandler.postDelayed(r, 200);
  }
Ejemplo n.º 2
0
  @Override
  public void onClick(View v) {
    if (password == null) {
      password = "";
    }
    switch (v.getId()) {
      case R.id.fibv_0:
        password += 0;
        break;
      case R.id.fibv_1:
        password += 1;
        break;
      case R.id.fibv_2:
        password += 2;
        break;
      case R.id.fibv_3:
        password += 3;
        break;
      case R.id.fibv_4:
        password += 4;
        break;
      case R.id.fibv_5:
        password += 5;
        break;
      case R.id.fibv_6:
        password += 6;
        break;
      case R.id.fibv_7:
        password += 7;
        break;
      case R.id.fibv_8:
        password += 8;
        break;
      case R.id.fibv_9:
        password += 9;
        break;
      case R.id.btn_del:
        if (password.length() > 0) {
          password = password.substring(0, password.length() - 1);
        }
        break;
      default:
        break;
    }

    indicator.passwordChanged(password);
    mHandler.postDelayed(r, 200);
  }
 @Override
 public void run() {
   if (password.length() > 4) {
     password = password.substring(0, 4);
   }
   if (password.length() == 4) {
     if (mConfig.getDigitalPassword().equals(MD5Utils.MD5(password))) {
       if (!getActivity().isFinishing()) {
         getActivity().finish();
         Intent intent = new Intent(getActivity(), CreatePasswordActivity.class);
         intent.putExtra(
             Constants.StringConstant.PARAMS_DATA, Constants.LockerMode.LOCK_MODE_DIGIT);
         startActivity(intent);
       }
     } else {
       indicator.passwordWrong();
       password = "";
     }
   }
 }
Ejemplo n.º 4
0
 @Override
 public void run() {
   if (password.length() > 4) {
     password = password.substring(0, 4);
   }
   if (password.length() == 4) {
     if (TextUtils.equals(MD5Utils.MD5(password), config.getDigitalPassword())) {
       if (isLaunchCamera) {
         AppUtils.launchCamera(getContext());
       } else if (notification != null) {
         try {
           notification.contentIntent.send();
         } catch (CanceledException e) {
           e.printStackTrace();
         }
       }
       LockerManager.getInstance(getContext()).unlock();
     } else {
       indicator.passwordWrong();
       password = "";
     }
   }
 }
Ejemplo n.º 5
0
 public void clearPassword() {
   password = "";
   indicator.passwordChanged(password);
 }