com.googlecode.androidannotations.annotations
Annotation Type TextChange


@Retention(value=CLASS)
@Target(value=METHOD)
public @interface TextChange

This annotation is intended to be used on methods to receive events defined by TextWatcher.onTextChanged(CharSequence s, int start, int before, int count) when the text is changed on the targeted TextView or subclass of TextView. The annotation value should be one or several R.id.* fields that refers to TextView or subclasses of TextView. If not set, the method name will be used as the R.id.* field name. The method may have multiple parameter :

Some usage examples of @BeforeTextChange annotation:
 @TextChange(R.id.helloTextView)
 void onTextChangesOnHelloTextView(CharSequence text, TextView hello, int before, int start, int count) {
        // Something Here
 }
 
 @TextChange
 void helloTextViewTextChanged(TextView hello) {
        // Something Here
 }
 
 @TextChange({R.id.editText, R.id.helloTextView})
 void onTextChangesOnSomeTextViews(TextView tv, CharSequence text) {
        // Something Here
 }
 
 @TextChange(R.id.helloTextView)
 void onTextChangesOnHelloTextView() {
        // Something Here
 }


Optional Element Summary
 String[] resName
           
 int[] value
           
 

value

public abstract int[] value
Default:
-1

resName

public abstract String[] resName
Default:
""


Copyright © 2010-2013. All Rights Reserved.