@Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.btn_title_right:
        if (checkInputInfo()) {
          if (!findpwd_pwd1_ET.getText().toString().equals(findpwd_pwd_ET.getText().toString())) {
            Toast.makeText(getApplicationContext(), "两次输入密码不一致", Toast.LENGTH_SHORT).show();
            break;
          }

          loadingoverlay.setVisibility(View.VISIBLE);
          loadingoverlay.setLoadingTip("正在提交,请稍候...");
          startSubmitTask();

        } else {
          String errmsg = getErrorMsg();
          Toast.makeText(getApplicationContext(), errmsg, Toast.LENGTH_SHORT).show();
        }

        break;
      case R.id.btn_title_left:
        // 返回登录

        this.finish();
        break;
      default:
        break;
    }
  }
Ejemplo n.º 2
0
 @Override
 public void onBackPressed() {
   if (loadingoverlay.getVisibility() != View.VISIBLE) {
     super.onBackPressed();
     System.exit(0);
   } else {
     if (biz != null) biz.cancel();
     loadingoverlay.setVisibility(View.INVISIBLE);
   }
 }
  private void initListener() {
    btn_title_right.setOnClickListener(this);
    btn_title_left.setOnClickListener(this);
    loadingoverlay.addOnCancelListener(
        new LoadingOverlay.OnCancelListener() {

          @Override
          public void onCancel() {

            if (regBiz != null) regBiz.cancel();
            loadingoverlay.setVisibility(View.INVISIBLE);
          }
        });

    findpwd_pwd_ET.addOnValidateListener(
        new ExEditText.OnValidateListener() {

          @Override
          public String onValidate(String text) {
            if (StringUtil.isNull(text)) return "请输入密码!";
            else return "";
          }
        });
    findpwd_pwd1_ET.addOnValidateListener(
        new ExEditText.OnValidateListener() {

          @Override
          public String onValidate(String text) {
            if (StringUtil.isNull(text)) return "请输入密码!";
            return "";
          }
        });
  }
Ejemplo n.º 4
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.registerTV:
        Intent intent1 = new Intent(getApplication(), RegisterActivity_Protocol.class);

        startActivity(intent1);

        break;
      case R.id.findpwdTV:
        Intent intent2 = new Intent(getApplication(), FindPWDActivity_InputPhone.class);

        startActivity(intent2);
        break;

      case R.id.loginButton:
        String userName = StringUtil.parseStr(userNameET.getText());
        String pwdmd5 = Tools.getMD5Str(passwordET.getText()).toUpperCase(Locale.US);
        String password = StringUtil.parseStr(pwdmd5);

        LoginInfoBean loginInfoBean = new LoginInfoBean();
        if (checkInputInfo(userName, password)) {

          loginInfoBean.setUsr_pwd(password);
          loginInfoBean.setUsr_account(userName.trim());
          // YtApplication.getInstance().setUserName(userName.trim());
          loadingoverlay.setVisibility(View.VISIBLE);
          loadingoverlay.setLoadingTip("正在登录,请稍候...");
          startLoginTask(loginInfoBean);

        } else {
          String errmsg = getErrorMsg();
          Toast.makeText(getApplicationContext(), errmsg, Toast.LENGTH_SHORT).show();
        }
        break;
      default:
    }
  }
Ejemplo n.º 5
0
  private void registerListener() {

    registerTV.setOnClickListener(this);
    findpwdTV.setOnClickListener(this);

    loginButton.setOnClickListener(this);

    loadingoverlay.addOnCancelListener(
        new LoadingOverlay.OnCancelListener() {

          @Override
          public void onCancel() {

            if (biz != null) biz.cancel();
            loadingoverlay.setVisibility(View.INVISIBLE);
          }
        });

    userNameET.addOnValidateListener(
        new ExEditText.OnValidateListener() {

          @Override
          public String onValidate(String text) {
            if (StringUtil.isNull(text)) return "请输入登录账号!";
            else return "";
          }
        });
    passwordET.addOnValidateListener(
        new ExEditText.OnValidateListener() {

          @Override
          public String onValidate(String text) {
            if (StringUtil.isNull(text)) return "请输入密码!";
            return "";
          }
        });
  }
Ejemplo n.º 6
0
 @Override
 protected void onPause() {
   super.onPause();
   if (biz != null) biz.cancel();
   loadingoverlay.setVisibility(View.INVISIBLE);
 }