You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
It's possible with a TextView to get notified when some changes are made within it by implementing a TextWatcher and pass it to the instance of the TextView. This is largely used with EditText (extends TextView) to interact with user events on this view.
I will start the implementation by providing two annotations :
@BeforeTextChange
Annotated method must have at least a CharSequence parameter, the start, count and after parameters can be all declared or none of them, (developers cannot annotate a method that declare one or two parameters among the three).
@TextChange
Same as above but the annotated method can take an Editable paremeter instead of the CharSequence parameter.
Those annotations can take multiple id as value parameters (like @click, @touch, etc...)
I think have one annotations for two methods is a bit complex for users. So the first implementation should offer three annotations :
@BeforeTextChange
@TextChange
@AfterTextChange
All the parameter will be optionals. the integers parameters are identified by their names (before, after, start, count). The CharSequence or Editable parameter (following context) are identified by their types. The targeted widget can be added as parameter of the annotated method.
It's possible with a
TextViewto get notified when some changes are made within it by implementing a TextWatcher and pass it to the instance of theTextView. This is largely used withEditText(extendsTextView) to interact with user events on this view.See TextWatcher interface here : http://developer.android.com/reference/android/text/TextWatcher.html
See EditText class here : http://developer.android.com/reference/android/widget/EditText.html
I think we could introduce three new annotations :
@BeforeTextChanged@TextChanged@AfterTextChanged