コード例 #1
0
 @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);
     }
   }
 }
コード例 #2
0
 public void beforeTextChanged(CharSequence s, int start, int before, int after) {
   if (mTextChangerListener != null) {
     mTextChangerListener.beforeTextChanged(s, start, before, after);
   }
 }
コード例 #3
0
 private void sendBeforeTextChanged(CharSequence newValue) {
   for (TextWatcher watcher : watchers) {
     watcher.beforeTextChanged(this.text, 0, this.text.length(), newValue.length());
   }
 }