@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.twitter);

    userName = (EditText) findViewById(R.id.twitter_username_text);
    password = (EditText) findViewById(R.id.twitter_password_text);
    loginButton = (Button) findViewById(R.id.twitter_login_button);

    loginButton.setEnabled(false);

    TextWatcher textWatcher =
        new TextWatcher() {
          public void afterTextChanged(Editable s) {
            String userNameText = WTTwitterLoginActivity.this.userName.getText().toString();
            String passwordText = WTTwitterLoginActivity.this.password.getText().toString();
            if (!userNameText.contentEquals("") && !passwordText.contentEquals("")) {
              loginButton.setEnabled(true);
            } else {
              loginButton.setEnabled(false);
            }
          }

          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          public void onTextChanged(CharSequence s, int start, int before, int count) {}
        };
    userName.addTextChangedListener(textWatcher);
    password.addTextChangedListener(textWatcher);
  }
  @TargetApi(11)
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_pens_calc, parent, false);
    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
    }

    pOkladZvan = (EditText) v.findViewById(R.id.edPOklad_zvan);
    pOkladDolg = (EditText) v.findViewById(R.id.edPOklad_dolg);
    pProcentNadbv = (EditText) v.findViewById(R.id.edPProcent_nadb);
    pKalendVisl = (EditText) v.findViewById(R.id.edKalendVisl);

    if (pens.getpOkladZvani() != 0) pOkladZvan.setText(String.valueOf((int) pens.getpOkladZvani()));
    if (pens.getpOkladDolg() != 0) pOkladDolg.setText(String.valueOf((int) pens.getpOkladDolg()));
    if (pens.getVislLetPoln() != 0)
      pProcentNadbv.setText(String.valueOf((int) pens.getVislLetPoln()));
    if (pens.getpKlandVisl() != 0) pKalendVisl.setText(String.valueOf((int) pens.getpKlandVisl()));

    pOkladZvan.addTextChangedListener(new GenericTextWatcher(pOkladZvan));
    pOkladDolg.addTextChangedListener(new GenericTextWatcher(pOkladDolg));
    pProcentNadbv.addTextChangedListener(new GenericTextWatcher(pProcentNadbv));
    pKalendVisl.addTextChangedListener(new GenericTextWatcher(pKalendVisl));
    pKalendVisl.setOnFocusChangeListener(new GenFocus());
    return v;
  }
  private void addXMLRPCPasswordHandler(
      final EditText field1, final EditText field2, final ImageView icon) {
    TextWatcher passwordListener =
        new TextWatcher() {
          public void afterTextChanged(Editable arg0) {}

          public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {}

          public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
            passwordOk = false;
            if (isPasswordCorrect(field1.getText().toString())
                && field1.getText().toString().equals(field2.getText().toString())) {
              passwordOk = true;
              icon.setImageResource(R.drawable.wizard_ok);
              errorMessage.setText("");
            } else {
              if (isPasswordCorrect(field1.getText().toString())) {
                errorMessage.setText(R.string.wizard_passwords_unmatched);
              } else {
                errorMessage.setText(R.string.wizard_password_incorrect);
              }
              icon.setImageResource(R.drawable.wizard_notok);
            }
            createAccount.setEnabled(usernameOk && passwordOk && emailOk);
          }
        };

    field1.addTextChangedListener(passwordListener);
    field2.addTextChangedListener(passwordListener);
  }
  /** 初始化控件 */
  private void initWidget() {
    // TODO Auto-generated method stub
    textTitle = (TextView) findViewById(R.id.headtitleplus_titleText);
    textProvinceCity = (EditText) findViewById(R.id.edit_second_add_info_one_address_first);
    textCounty = (EditText) findViewById(R.id.edit_second_add_info_one_address_second);
    textError = (TextView) findViewById(R.id.text_paymentbycredit_second_add_info_one_email_error);
    editEmail = (EditText) findViewById(R.id.edit_second_add_info_one_email);
    editCompanyName = (EditText) findViewById(R.id.edit_second_add_info_one_company);
    editCompanyDetailAddress = (EditText) findViewById(R.id.edit_second_add_info_one_address_third);
    btnNext = (Button) findViewById(R.id.button_paymentbycredit_second_add_info_one_next);
    btnBack = (InterceptLinearLayout) findViewById(R.id.headtitleplus_backParentLayout);
    btnNext.setOnClickListener(this);
    btnBack.setOnClickListener(this);
    //		textProvinceCity.setOnClickListener(this);
    //		textCounty.setOnClickListener(this);
    textTitle.setText(R.string.paymentbycredit_signup);

    editEmail.addTextChangedListener(this);
    editCompanyName.addTextChangedListener(this);
    textProvinceCity.addTextChangedListener(this);
    textCounty.addTextChangedListener(this);
    editCompanyDetailAddress.addTextChangedListener(this);

    intentFilter = new IntentFilter(PaymentByCreditIntents.CREDITPAYMENT_FINISH_ACTIVITY);
    LocalBroadcastManager.getInstance(this).registerReceiver(finishReceiver, intentFilter);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_vehicle);
    editTextVehicleID = (EditText) findViewById(R.id.edit_text_vehicle_id);
    editTextVehicleID.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            editTextChecker(editTextVehicleID);
          }
        });
    editTextVehicleName = (EditText) findViewById(R.id.edit_text_vehicle_name);
    editTextVehicleName.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            editTextChecker(editTextVehicleName);
          }
        });
    editTextVehicleInfo = (EditText) findViewById(R.id.edit_text_vehicle_info);
  }
  @Override
  protected void onResume() {
    super.onResume();

    btnUpdateProfile.setOnClickListener(this);

    txtInputLastName.addTextChangedListener(new UpdateProfileFormTextWatcher(txtInputLastName));
    txtInputFirstName.addTextChangedListener(new UpdateProfileFormTextWatcher(txtInputFirstName));
    txtInputPhoneNumber.addTextChangedListener(
        new UpdateProfileFormTextWatcher(txtInputPhoneNumber));
    txtInputConfirmPassword.addTextChangedListener(
        new UpdateProfileFormTextWatcher(txtInputConfirmPassword));

    loadInsuranceProvider();
    loadUserDOB();
    loadUserHeight();
    loadUserWeight();

    lastName = user.getLastName();
    firstName = user.getFirstName();
    phoneNumber = user.getPhoneNumber();

    if (null != lastName) {
      txtInputLastName.setText(lastName);
    }

    if (null != firstName) {
      txtInputFirstName.setText(firstName);
    }

    if (null != phoneNumber) {
      txtInputPhoneNumber.setText(phoneNumber);
    }
  }
Esempio n. 7
0
  @Override
  public void onStart() {
    super.onStart();

    AlertDialog dialog = (AlertDialog) getDialog();

    dialog
        .getButton(AlertDialog.BUTTON_NEGATIVE)
        .setTextColor(ColorScheme.getPrimaryText(getActivity()));

    positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
    positiveButton.setTextColor(ColorScheme.getAccent());
    positiveButton.setEnabled(false);

    editFileName.setOnFocusChangeListener(
        new View.OnFocusChangeListener() {

          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            fromUser = hasFocus;
          }
        });

    editScriptName.addTextChangedListener(scriptNameTextWatcher);
    editFileName.addTextChangedListener(fileNameTextWatcher);

    KeyboardUtils.showKeyboard(editScriptName, true);
  }
Esempio n. 8
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add);

    mImage = (ImageButton) findViewById(R.id.image);
    mIssuer = (EditText) findViewById(R.id.issuer);
    mLabel = (EditText) findViewById(R.id.label);
    mSecret = (EditText) findViewById(R.id.secret);
    mInterval = (EditText) findViewById(R.id.interval);
    mCounter = (EditText) findViewById(R.id.counter);
    mAlgorithm = (Spinner) findViewById(R.id.algorithm);
    mHOTP = (RadioButton) findViewById(R.id.hotp);

    // Select the default algorithm
    mAlgorithm.setSelection(SHA1_OFFSET);

    // Setup the Counter toggle
    mHOTP.setOnCheckedChangeListener(this);

    // Setup the buttons
    findViewById(R.id.cancel).setOnClickListener(this);
    findViewById(R.id.add).setOnClickListener(this);
    findViewById(R.id.add).setEnabled(false);
    mImage.setOnClickListener(this);

    // Set constraints on when the Add button is enabled
    TextWatcher tw = new AddTextWatcher(this);
    mIssuer.addTextChangedListener(tw);
    mLabel.addTextChangedListener(tw);
    mSecret.addTextChangedListener(new AddSecretTextWatcher(this));
    mInterval.addTextChangedListener(tw);
  }
Esempio n. 9
0
  private void initData() {
    uid = PrefUtils.getString(CreateGroupActivity.this, "uid", "");
    rg_group.check(R.id.rb_100);

    rg_group.setOnCheckedChangeListener(
        new OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
            switch (checkedId) {
              case R.id.rb_100:
                num = "100";
                break;
              case R.id.rb_200:
                num = "200";
                break;
              case R.id.rb_500:
                num = "500";
                break;
              case R.id.rb_1000:
                num = "1000";
                break;
            }
          }
        });

    et_group_intro.addTextChangedListener(this);
    et_group_name.addTextChangedListener(this);
  }
  public void addMascaras() {
    // Adicionar Mascara aos campos Bolsa Orientador
    editTextBolsaOrientador.addTextChangedListener(Mascara.money(editTextBolsaOrientador));

    // Adicionar Mascara aos campos Bolsa Discente
    editTextBolsaDiscente.addTextChangedListener(Mascara.money(editTextBolsaDiscente));
  }
Esempio n. 11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_set);

    address = (EditText) this.findViewById(R.id.address);
    port = (EditText) this.findViewById(R.id.port);
    save = (Button) this.findViewById(R.id.btn_save);

    localUserInfo = LocalUserInfo.getInstance(this);
    address.setText(localUserInfo.getUserInfo(ADDRESS));
    port.setText(localUserInfo.getUserInfo(PORT));
    address.addTextChangedListener(new TextChange());
    port.addTextChangedListener(new TextChange());

    save.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            localUserInfo.setUserInfo(ADDRESS, address.getText().toString().trim());
            localUserInfo.setUserInfo(PORT, port.getText().toString().trim());
            startActivity(new Intent(SetActivity.this, LoginActivity.class));
            finish();
          }
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    res = getResources();
    setContentView(R.layout.flatplanefrictionactivity);

    Spinner solveFor = (Spinner) findViewById(R.id.spinner1);
    solveFor.setOnItemSelectedListener(updateSolveFor);

    EditText t2 = (EditText) findViewById(R.id.editText2);
    t2.addTextChangedListener(updateAnswer);
    EditText t4 = (EditText) findViewById(R.id.editText4);
    t4.addTextChangedListener(updateAnswer);
    EditText t6 = (EditText) findViewById(R.id.editText6);
    t6.addTextChangedListener(updateAnswer);
    EditText t8 = (EditText) findViewById(R.id.editText8);
    t8.addTextChangedListener(updateAnswer);
    Spinner units3 = (Spinner) findViewById(R.id.spinner3);
    units3.setOnItemSelectedListener(updateUnits);
    Spinner units5 = (Spinner) findViewById(R.id.spinner5);
    units5.setOnItemSelectedListener(updateUnits);
    Spinner units7 = (Spinner) findViewById(R.id.spinner7);
    units7.setOnItemSelectedListener(updateUnits);
    Spinner units9 = (Spinner) findViewById(R.id.spinner9);
    units9.setOnItemSelectedListener(updateUnits);
    Spinner units11 = (Spinner) findViewById(R.id.spinner11);
    units11.setOnItemSelectedListener(updateUnits);
  }
Esempio n. 13
0
  public void registerValidation() {
    newPass = (EditText) findViewById(R.id.password);
    confirmNewPass = (EditText) findViewById(R.id.verifyPassword);

    newPass.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void afterTextChanged(Editable s) {
            validationRegister.isValidPassword(newPass, confirmNewPass, 0);
          }
        });

    confirmNewPass.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void afterTextChanged(Editable s) {
            validationRegister.isValidPassword(confirmNewPass, newPass, 0);
          }
        });
  }
Esempio n. 14
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_login, container, false);
    mLoginButton = view.findViewById(R.id.btn_login);
    mEmailView = (EditText) view.findViewById(R.id.txt_email);
    mPasswordView = (EditText) view.findViewById(R.id.txt_password);
    mEmailView.addTextChangedListener(this);
    mPasswordView.addTextChangedListener(this);

    mPasswordView.setOnKeyListener(
        new OnKeyListener() {
          @Override
          public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN) {
              ((LoginActivity) getActivity()).login(null);
              return true;
            } else {
              return false;
            }
          }
        });

    updateLoginButtonEnabledState();
    return view;
  }
Esempio n. 15
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View tambahJadwal = inflater.inflate(R.layout.fragment_tambah_jadwal, container, false);
    inputLayoutName = (TextInputLayout) tambahJadwal.findViewById(R.id.input_layout_name);
    inputLayoutEmail = (TextInputLayout) tambahJadwal.findViewById(R.id.input_layout_email);
    // inputLayoutPassword = (TextInputLayout)
    // tambahJadwal.findViewById(R.id.input_layout_password);
    inputName = (EditText) tambahJadwal.findViewById(R.id.input_name);
    inputEmail = (EditText) tambahJadwal.findViewById(R.id.input_email);
    // inputPassword = (EditText) tambahJadwal.findViewById(R.id.input_password);
    btnSignUp = (Button) tambahJadwal.findViewById(R.id.submit_tambah_jadwal);

    inputName.addTextChangedListener(new MyTextWatcher(inputName));
    inputEmail.addTextChangedListener(new MyTextWatcher(inputEmail));
    //        inputPassword.addTextChangedListener(new MyTextWatcher(inputPassword));

    btnSignUp.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            // submitForm();
            Snackbar.make(view, "Mantap", Snackbar.LENGTH_SHORT).show();
          }
        });

    getDialog().setTitle("Silakan");

    return tambahJadwal;
  }
Esempio n. 16
0
  /**
   * Configure search field
   *
   * @param search
   * @param beerListItemAdapter
   * @param searchBtn
   */
  private void setUpSearchView(
      final EditText search,
      final BeerListItemAdapter beerListItemAdapter,
      final ImageView searchBtn) {
    search.addTextChangedListener(beerListItemAdapter);
    searchBtn.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if (search.getText().length() > 0) {
              search.setText("");
            } else {
              search.requestFocus();
            }
          }
        });
    search.addTextChangedListener(
        new TextWatcher() {

          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (s.length() > 0) {
              searchBtn.setImageResource(R.drawable.ic_clear_white_24dp);
            } else {
              searchBtn.setImageResource(R.drawable.ic_search_white_24dp);
            }
          }

          @Override
          public void afterTextChanged(Editable s) {}
        });
  }
Esempio n. 17
0
  /**
   * Recupera as views e configura os listeners para os campos editáveis e para o botão de entrar
   */
  private void initViews() {
    resources = getResources();

    TextWatcher textWatcher =
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            callClearErrors(s);
          }
        };

    edtUser = (EditText) findViewById(R.id.etUsuario);
    edtUser.addTextChangedListener(textWatcher);
    edtPassword = (EditText) findViewById(R.id.etSenha);
    edtPassword.addTextChangedListener(textWatcher);
    Button btnEnter = (Button) findViewById(R.id.botaoLogar);
    btnEnter.setOnClickListener(this);
    Button btnCds = (Button) findViewById(R.id.botaoCadastrar);
    btnCds.setOnClickListener(this);
    Button btnLmp = (Button) findViewById(R.id.botaoLimpar);
    btnLmp.setOnClickListener(this);
  }
  // @Override
  protected void onBindDialogView(View view) {
    PasswordPreference preference = ((PasswordPreference) getPreference());
    password1 = (EditText) view.findViewById(R.id.password1);
    password2 = (EditText) view.findViewById(R.id.password2);
    protect = (CheckBox) view.findViewById(R.id.performProtection);
    change = (CheckBox) view.findViewById(R.id.changePassword);
    password2Wrapper = (TextInputLayout) view.findViewById(R.id.password2Wrapper);
    String warning =
        ContribFeature.SECURITY_QUESTION.hasAccess()
            ? getContext().getString(R.string.warning_password_contrib)
            : (getContext().getString(R.string.warning_password_no_contrib)
                + " "
                + ContribFeature.SECURITY_QUESTION.buildRequiresString(getContext()));
    ((TextView) view.findViewById(R.id.password_warning)).setText(warning);
    main = (LinearLayout) view.findViewById(R.id.layoutMain);
    edit = (LinearLayout) view.findViewById(R.id.layoutPasswordEdit);
    boolProtectOrig = preference.getValue();
    boolProtect = boolProtectOrig;
    protect.setChecked(boolProtect);
    if (boolProtect) {
      main.setVisibility(View.VISIBLE);
      view.findViewById(R.id.layoutChangePasswordCheckBox).setVisibility(View.VISIBLE);
      edit.setVisibility(View.GONE);
    }

    password1.addTextChangedListener(this);
    password2.addTextChangedListener(this);
    protect.setOnCheckedChangeListener(this);
    change.setOnCheckedChangeListener(this);
    super.onBindDialogView(view);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.create_account, container, false);
    username = (EditText) v.findViewById(R.id.create_account_username);
    username.addTextChangedListener(mTextWatcher);
    password = (EditText) v.findViewById(R.id.create_account_password);
    password.addTextChangedListener(mTextWatcher);
    confirmPassword = (EditText) v.findViewById(R.id.create_account_confirm_password);
    confirmPassword.addTextChangedListener(mTextWatcher);
    errorText = (TextView) v.findViewById(R.id.error_label);
    mSettingsWarningLabel = (TextView) v.findViewById(R.id.settings_warn_label);
    createButton = (Button) v.findViewById(R.id.next);
    createButton.setOnClickListener(this);
    serverEdit = (AutoCompleteTextView) v.findViewById(R.id.xmpp_server);
    ArrayAdapter<CharSequence> completeAdapter =
        ArrayAdapter.createFromResource(
            getActivity(), R.array.xmpp_server_list, R.layout.simple_combobox_item);

    serverEdit.setAdapter(completeAdapter);
    serverEdit.addTextChangedListener(mTextWatcher);
    // show the list on second click on the text view
    serverEdit.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            serverEdit.showDropDown();
          }
        });
    return v;
  }
  private void setupEditText() {
    etSummary.setHint(getResources().getString(R.string.booking_summary));
    etSummary.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            summaryText = s.toString();
          }
        });

    etDetails.setHint(getResources().getString(R.string.event_details));
    etDetails.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            detailsText = s.toString();
          }
        });
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_change_password);

    ActionbarUtil.showActionBarwithBack(this, getString(R.string.acct_change_password_title));

    final EditText changePasswordTxt = (EditText) findViewById(R.id.changePasswordTxt);
    changePasswordTxt.setEnabled(false);

    String passwordPref = Preferences.getPreference(getApplicationContext(), Preferences.PASSWORD);
    changePasswordTxt.setText(passwordPref);

    final EditText newPasswordTxt = (EditText) findViewById(R.id.newPasswordTxt);
    newPasswordTxt.addTextChangedListener(mNewPasswordTxtWatcher);
    mNewPasswordErrorTooltip = (TooltipErrorView) findViewById(R.id.newPasswordErrorTooltip);

    final EditText repeatNewPasswordTxt = (EditText) findViewById(R.id.repeatNewPasswordTxt);
    repeatNewPasswordTxt.addTextChangedListener(mRepeatNewPasswordTxtWatcher);
    mRepeatNewPasswordErrorTooltip =
        (TooltipErrorView) findViewById(R.id.repeatNewPasswordErrorTooltip);

    repeatNewPasswordTxt.setOnEditorActionListener(
        new OnEditorActionListener() {
          @Override
          public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

            if (actionId == EditorInfo.IME_ACTION_DONE) {

              final String currentPassword = changePasswordTxt.getText().toString();
              final String newPassword = newPasswordTxt.getText().toString();
              final String repeatNewPassword = repeatNewPasswordTxt.getText().toString();

              // change password
              changePassword(currentPassword, newPassword, repeatNewPassword);
            }
            return false;
          }
        });

    final Button changePasswordBtn = (Button) findViewById(R.id.changePasswordBtn);
    changePasswordBtn.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {

            final String currentPassword = changePasswordTxt.getText().toString();
            final String newPassword = newPasswordTxt.getText().toString();
            final String repeatNewPassword = repeatNewPasswordTxt.getText().toString();

            // change password
            changePassword(currentPassword, newPassword, repeatNewPassword);
          }
        });

    mProgressDialog = new ProgressDialog(this);
    mProgressDialog.setMessage(getString(R.string.acct_message_changing_password));
    mProgressDialog.setCancelable(false);
  }
Esempio n. 22
0
 public void initListener() {
   deleteButton.setOnClickListener(this);
   changeButton.setOnClickListener(this);
   etTitle.addTextChangedListener(this);
   etUserName.addTextChangedListener(this);
   etPassWord.addTextChangedListener(this);
   etDescribe.addTextChangedListener(this);
 }
Esempio n. 23
0
  @Override
  protected void init(@Nullable Bundle savedInstanceState) {
    super.init(savedInstanceState);

    btnLogin.setOnClickListener(this);
    edtEmail.addTextChangedListener(this);
    edtPassword.addTextChangedListener(this);
  }
Esempio n. 24
0
 void setData() {
   btn_NewRegister.setOnClickListener(this);
   btn_Login.setOnClickListener(this);
   img_DelPassword.setOnClickListener(this);
   imgButton_Bak.setOnClickListener(this);
   edit_UserName.addTextChangedListener(new EditWatcher(FLAG_EDIT_USERNAME));
   edit_Password.addTextChangedListener(new EditWatcher(FLAG_EDIT_PASSWORD));
 }
Esempio n. 25
0
  private void initViews() {
    mETAccount = (EditText) findViewById(R.id.et_account);
    mETPasswd = (EditText) findViewById(R.id.et_passwd);
    mLoginBtn = (Button) findViewById(R.id.btn_login);
    mRegisterBtn = (Button) findViewById(R.id.btn_register);

    mETAccount.addTextChangedListener(new TextChange());
    mETPasswd.addTextChangedListener(new TextChange());
  }
  private void addListeners() {
    gen.setOnCheckedChangeListener(
        new RadioGroup.OnCheckedChangeListener() {
          public void onCheckedChanged(RadioGroup rGroup, int checkedId) {
            gendererror.setVisibility(View.GONE);
          }
        });

    if (eddob != null) {
      eddob.setOnClickListener(
          new View.OnClickListener() {

            @Override
            public void onClick(View v) {
              Calendar currentDate = Calendar.getInstance();
              int cYear = currentDate.get(Calendar.YEAR);
              int cMonth = currentDate.get(Calendar.MONTH);
              int cDay = currentDate.get(Calendar.DAY_OF_MONTH);

              edmonth.getText().clear();
              edyr.getText().clear();

              DatePickerDialog mDatePicker =
                  new DatePickerDialog(
                      RegisterPatientFragment.this.getActivity(),
                      new DatePickerDialog.OnDateSetListener() {
                        public void onDateSet(
                            DatePicker datepicker,
                            int selectedyear,
                            int selectedmonth,
                            int selectedday) {
                          eddob.setText(selectedday + "/" + selectedmonth + "/" + selectedyear);
                          birthdate = new LocalDate(selectedyear, selectedmonth, selectedday);
                          bdt = birthdate.toDateTimeAtStartOfDay().toDateTime();
                        }
                      },
                      cYear,
                      cMonth,
                      cDay);
              mDatePicker.setTitle("Select Date");
              mDatePicker.show();
            }
          });
    }
    registerConfirm.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            mPresenter.confirm(createPatient());
          }
        });

    TextWatcher textWatcher = new RegisterPatientBirthdateValidatorWatcher(eddob, edmonth, edyr);
    edmonth.addTextChangedListener(textWatcher);
    edyr.addTextChangedListener(textWatcher);
  }
Esempio n. 27
0
 // 设置监听事件
 private void setEventListeners() {
   moEditUsername.addTextChangedListener(new OnEditUsername());
   moEditPassword.addTextChangedListener(new OnEditPassword());
   moBtnClearUsername.setOnClickListener(new OnClearEditText());
   moBtnClearPassword.setOnClickListener(new OnClearEditText());
   moImgSlider.setOnClickListener(new OnSliderClicked());
   moImgSlider.setOnTouchListener(new OnSliderDragged());
   // moBtnRegister.setOnClickListener(new OnRegister());
   moBtnTraveller.setOnClickListener(new OnTravell());
 }
Esempio n. 28
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.exchange);
    Intent i = getIntent();
    country = i.getStringExtra("fCountry");
    currency = i.getStringExtra("fCurr");
    rate = i.getDoubleExtra("fRate", 1);
    amount = i.getIntExtra("fAmount", 1);

    ((TextView) findViewById(R.id.foreignCountry)).setText(country);
    ((TextView) findViewById(R.id.foreignCurrency)).setText(currency);
    ((TextView) findViewById(R.id.foreignRate)).setText(String.valueOf(rate));
    ((ImageView) findViewById(R.id.foreignFlag)).setBackgroundResource(Flags.get(currency));
    czkAmount = (EditText) findViewById(R.id.czkInput);
    forAmount = (EditText) findViewById(R.id.foreignInput);
    czkAmount.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            if (!czkAmount.hasFocus()) return;
            try {
              forAmount.setText(
                  String.valueOf(Double.valueOf(charSequence.toString()) / rate * amount));
            } catch (Exception e) {
              e.printStackTrace();
            }
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
    forAmount.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            if (!forAmount.hasFocus()) return;
            try {
              czkAmount.setText(
                  String.valueOf(Double.valueOf(charSequence.toString()) * rate / amount));
            } catch (Exception e) {
              e.printStackTrace();
            }
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
  }
  @NonNull
  @Override
  public Dialog onCreateDialog(Bundle savedInstanceState) {
    final View content =
        getActivity().getLayoutInflater().inflate(R.layout.config_setter_dialog, null);
    editChannelId = (EditText) content.findViewById(R.id.editChannelId);
    editChannelId.setText(previousChannelId);
    editChannelId.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            final String text = s.toString();
            if (isFieldValid(text)) {
              editChannelId.setError(null);
            } else {
              editChannelId.setError(getString(R.string.empty_field));
            }
          }
        });
    editApiKey = (EditText) content.findViewById(R.id.editApiKey);
    editApiKey.setText(previousApiKey);
    editApiKey.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            if (isFieldValid(s.toString())) {
              editApiKey.setError(null);
            } else {
              editApiKey.setError(getString(R.string.empty_field));
            }
          }
        });

    final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder
        .setTitle(R.string.sessionconfig_dialog_title)
        .setView(content)
        // Button clicks are handled by the DialogFragment!
        .setPositiveButton(android.R.string.ok, null)
        .setNegativeButton(R.string.exit, null);
    return builder.create();
  }
Esempio n. 30
0
  public void resetSaveButton() {
    et_username.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            btnSave.setProgress(0);
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
    et_email.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            btnSave.setProgress(0);
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
    et_address.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            btnSave.setProgress(0);
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
    et_password.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}

          @Override
          public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            btnSave.setProgress(0);
          }

          @Override
          public void afterTextChanged(Editable editable) {}
        });
  }