Class DynamicTextWatcher

  • All Implemented Interfaces:
    android.text.NoCopySpan, android.text.TextWatcher

    public abstract class DynamicTextWatcher
    extends java.lang.Object
    implements android.text.TextWatcher
    A TextWatcher to delay the text changed event.
    See Also:
    TextWatcher.afterTextChanged(Editable)
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.text.NoCopySpan

        android.text.NoCopySpan.Concrete
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long DELAY_TEXT_CHANGE
      Default value in milliseconds by which the text changed event should be delayed.
      static int MESSAGE_TEXT_CHANGED
      Message constant to dispatch the text change event.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void afterTextChanged​(android.text.Editable s)  
      void beforeTextChanged​(java.lang.CharSequence s, int start, int count, int after)  
      abstract void delayedTextChanged​(android.text.Editable s)
      This method will be called after delaying the text changed event.
      android.os.Handler getHandler()
      Returns the handler used by this watcher to delay the text changed event.
      long getTextChangeDelay()
      Returns the delay in milliseconds by which the text changed event should be delayed.
      void onTextChanged​(java.lang.CharSequence s, int start, int before, int count)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MESSAGE_TEXT_CHANGED

        public static final int MESSAGE_TEXT_CHANGED
        Message constant to dispatch the text change event.
        See Also:
        Constant Field Values
      • DELAY_TEXT_CHANGE

        public static final long DELAY_TEXT_CHANGE
        Default value in milliseconds by which the text changed event should be delayed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DynamicTextWatcher

        public DynamicTextWatcher()
    • Method Detail

      • beforeTextChanged

        public void beforeTextChanged​(java.lang.CharSequence s,
                                      int start,
                                      int count,
                                      int after)
        Specified by:
        beforeTextChanged in interface android.text.TextWatcher
      • onTextChanged

        public void onTextChanged​(java.lang.CharSequence s,
                                  int start,
                                  int before,
                                  int count)
        Specified by:
        onTextChanged in interface android.text.TextWatcher
      • afterTextChanged

        public void afterTextChanged​(android.text.Editable s)
        Specified by:
        afterTextChanged in interface android.text.TextWatcher
      • delayedTextChanged

        public abstract void delayedTextChanged​(android.text.Editable s)
        This method will be called after delaying the text changed event.
        Parameters:
        s - The text after the change.
        See Also:
        afterTextChanged(Editable)
      • getTextChangeDelay

        public long getTextChangeDelay()
        Returns the delay in milliseconds by which the text changed event should be delayed.
        Returns:
        The delay in milliseconds by which the text changed event should be delayed.
      • getHandler

        @NonNull
        public android.os.Handler getHandler()
        Returns the handler used by this watcher to delay the text changed event.
        Returns:
        The handler used by this watcher to delay the text changed event.