/** * Expose a text watcher to receive updates when the cvc number is changed. * * @param postalCodeTextWatcher */ public void setPostalCodeTextWatcher(TextWatcher postalCodeTextWatcher) { mPostalCodeEditText.addTextChangedListener(postalCodeTextWatcher); }
/** * Expose a text watcher to receive updates when the cvc number is changed. * * @param cvcNumberTextWatcher */ public void setCvcNumberTextWatcher(TextWatcher cvcNumberTextWatcher) { mCvcEditText.addTextChangedListener(cvcNumberTextWatcher); }
/** * Expose a text watcher to receive updates when the cvc number is changed. */ public void setCvcNumberTextWatcher(TextWatcher cvcNumberTextWatcher) { mCvcNumberEditText.addTextChangedListener(cvcNumberTextWatcher); }
private void listenForTextChanges() { addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // purposefully not implemented. } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // purposefully not implemented. } @Override public void afterTextChanged(Editable s) { if (mAfterTextChangedListener != null) { mAfterTextChangedListener.onTextChanged(s.toString()); } } }); }
private void initView() { setOrientation(VERTICAL); inflate(getContext(), R.layout.add_address_widget, this); mCountryAutoCompleteTextView = findViewById(R.id.country_autocomplete_aaw); mAddressLine1TextInputLayout = findViewById(R.id.tl_address_line1_aaw); mAddressLine2TextInputLayout = findViewById(R.id.tl_address_line2_aaw); mCityTextInputLayout = findViewById(R.id.tl_city_aaw); mNameTextInputLayout = findViewById(R.id.tl_name_aaw); mPostalCodeTextInputLayout = findViewById(R.id.tl_postal_code_aaw); mStateTextInputLayout = findViewById(R.id.tl_state_aaw); mAddressEditText = findViewById(R.id.et_address_line_one_aaw); mAddressEditText2 = findViewById(R.id.et_address_line_two_aaw); mCityEditText = findViewById(R.id.et_city_aaw); mNameEditText = findViewById(R.id.et_name_aaw); mPostalCodeEditText = findViewById(R.id.et_postal_code_aaw); mStateEditText = findViewById(R.id.et_state_aaw); mPhoneNumberEditText = findViewById(R.id.et_phone_number_aaw); mPhoneNumberTextInputLayout = findViewById(R.id.tl_phone_number_aaw); mCountryAutoCompleteTextView.setCountryChangeListener(new CountryAutoCompleteTextView .CountryChangeListener() { @Override public void onCountryChanged(String countryCode) { renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); } }); mPhoneNumberEditText.addTextChangedListener(new PhoneNumberFormattingTextWatcher()); setupErrorHandling(); renderLabels(); renderCountrySpecificLabels(mCountryAutoCompleteTextView.getSelectedCountryCode()); }