Java Code Examples for android.widget.EditText#removeTextChangedListener()
The following examples show how to use
android.widget.EditText#removeTextChangedListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChipTextInputComboView.java From material-components-android with Apache License 2.0 | 5 votes |
public void setText(CharSequence text) { chip.setText(text); EditText editText = textInputLayout.getEditText(); if (!TextUtils.isEmpty(editText.getText())) { editText.removeTextChangedListener(watcher); editText.setText(null); editText.setHint(HintSetterTextWatcher.DEFAULT_HINT); editText.addTextChangedListener(watcher); } editText.setHint(text); }
Example 2
Source File: PasswordToggleEndIconDelegate.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void onEditTextAttached(@NonNull TextInputLayout textInputLayout) { EditText editText = textInputLayout.getEditText(); textInputLayout.setEndIconVisible(true); textInputLayout.setEndIconCheckable(true); endIconView.setChecked(!hasPasswordTransformation()); // Make sure there's always only one password toggle text watcher added editText.removeTextChangedListener(textWatcher); editText.addTextChangedListener(textWatcher); }
Example 3
Source File: PasswordToggleEndIconDelegate.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void onEndIconChanged(@NonNull TextInputLayout textInputLayout, int previousIcon) { EditText editText = textInputLayout.getEditText(); if (editText != null && previousIcon == TextInputLayout.END_ICON_PASSWORD_TOGGLE) { // If the end icon was the password toggle add it back the PasswordTransformation // in case it might have been removed to make the password visible. editText.setTransformationMethod(PasswordTransformationMethod.getInstance()); // Remove any listeners set on the edit text. editText.removeTextChangedListener(textWatcher); } }
Example 4
Source File: ClearTextEndIconDelegate.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void onEditTextAttached(@NonNull TextInputLayout textInputLayout) { EditText editText = textInputLayout.getEditText(); textInputLayout.setEndIconVisible(editText.hasFocus() && hasText(editText.getText())); // Make sure there's always only one clear text text watcher added textInputLayout.setEndIconCheckable(false); editText.setOnFocusChangeListener(onFocusChangeListener); editText.removeTextChangedListener(clearTextEndIconTextWatcher); editText.addTextChangedListener(clearTextEndIconTextWatcher); }
Example 5
Source File: ClearTextEndIconDelegate.java From material-components-android with Apache License 2.0 | 5 votes |
@Override public void onEndIconChanged(@NonNull TextInputLayout textInputLayout, int previousIcon) { EditText editText = textInputLayout.getEditText(); if (editText != null && previousIcon == TextInputLayout.END_ICON_CLEAR_TEXT) { // Remove any listeners set on the edit text. editText.removeTextChangedListener(clearTextEndIconTextWatcher); if (editText.getOnFocusChangeListener() == onFocusChangeListener) { editText.setOnFocusChangeListener(null); } } }
Example 6
Source File: EditTextUtils.java From PatternedTextWatcher with MIT License | 5 votes |
public static void clearTextChangeListener(EditText editText, PatternedTextWatcher watcher, boolean clearText) { editText.removeTextChangedListener(watcher); if (clearText) { editText.getText().clear(); } else { editText.setSelection(editText.length()); } }
Example 7
Source File: editsUtils.java From Color-picker-library with GNU General Public License v3.0 | 4 votes |
static void disableEditText(EditText editHEX, EditText someRGB, TextWatcher someRGBWatcher, TextWatcher hexWatcher) { someRGB.removeTextChangedListener(someRGBWatcher); someRGB.setEnabled(false); editHEX.removeTextChangedListener(hexWatcher); editHEX.setEnabled(false); }
Example 8
Source File: EditTextUtils.java From PatternedTextWatcher with MIT License | 4 votes |
public static void clearTextChangeListener(EditText editText, PatternedTextWatcher watcher) { editText.removeTextChangedListener(watcher); }
Example 9
Source File: MeDigiSeg.java From Makeblock-App-For-Android with MIT License | 4 votes |
public void setDisable(){ ed = (EditText) view.findViewById(R.id.editTxt); ed.setEnabled(false); ed.removeTextChangedListener(this); stopTimer(); }