@Override public void setText(CharSequence text, BufferType type) { if (mTextWatchersEnabled) { for (TextWatcher textWatcher : mTextWatchers) { textWatcher.beforeTextChanged(getCleanText(), 0, 0, 0); } } super.setText(text, type); if (text != null && !mIsInserting) { setSelection(getText().length()); } invalidateTextSize(); if (mTextWatchersEnabled) { for (TextWatcher textWatcher : mTextWatchers) { textWatcher.afterTextChanged(getEditableFactory().newEditable(getCleanText())); textWatcher.onTextChanged(getCleanText(), 0, 0, 0); } } }
public void beforeTextChanged(CharSequence s, int start, int before, int after) { if (mTextChangerListener != null) { mTextChangerListener.beforeTextChanged(s, start, before, after); } }
private void sendBeforeTextChanged(CharSequence newValue) { for (TextWatcher watcher : watchers) { watcher.beforeTextChanged(this.text, 0, this.text.length(), newValue.length()); } }