public void onTextChanged(CharSequence s, int start, int before, int after) { LcSearchView.this.onTextChanged(s); if (mTextChangerListener != null) { mTextChangerListener.onTextChanged(s, start, before, after); } }
@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); } } }
@Override public void addTextChangedListener(TextWatcher watcher) { // Some flavors of Android call addTextChangedListener in the constructor, so add a // null check to mTextWatchers if (watcher.equals(mTextWatcher) || mTextWatchers == null) { super.addTextChangedListener(watcher); } else { mTextWatchers.add(watcher); } }
public void afterTextChanged(Editable s) { if (mTextChangerListener != null) { mTextChangerListener.afterTextChanged(s); } }
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()); } }
private void sendOnTextChanged(CharSequence oldValue) { for (TextWatcher watcher : watchers) { watcher.onTextChanged(text, 0, oldValue.length(), text.length()); } }
private void sendAfterTextChanged() { for (TextWatcher watcher : watchers) { watcher.afterTextChanged(new SpannableStringBuilder(getText())); } }