| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Since AndroidAnnotations 2.6
This annotation is intended to be used on methods to receive events defined by android.text.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
}This annotation is intended to be used on methods to receive events defined by android.text.TextWatcher.beforeTextChanged(CharSequence s, int start, int count, int after) before 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 parameters:
Some usage examples of @BeforeTextChange annotation:
@BeforeTextChange(R.id.helloTextView)
void beforeTextChangedOnHelloTextView(TextView hello, CharSequence text, int start, int count, int after) {
// Something Here
}
@BeforeTextChange
void helloTextViewBeforeTextChanged(TextView hello) {
// Something Here
}
@BeforeTextChange({R.id.editText, R.id.helloTextView})
void beforeTextChangedOnSomeTextViews(TextView tv, CharSequence text) {
// Something Here
}
@BeforeTextChange(R.id.helloTextView)
void beforeTextChangedOnHelloTextView() {
// Something Here
}This annotation is intended to be used on methods to receive events defined by android.text.TextWatcher.afterTextChanged(Editable s) after 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 :
@AfterTextChange(R.id.helloTextView)
void afterTextChangedOnHelloTextView(Editable text, TextView hello) {
// Something Here
}
@AfterTextChange
void helloTextViewAfterTextChanged(TextView hello) {
// Something Here
}
@AfterTextChange({R.id.editText, R.id.helloTextView})
void afterTextChangedOnSomeTextViews(TextView tv, Editable text) {
// Something Here
}
@AfterTextChange(R.id.helloTextView)
void afterTextChangedOnHelloTextView() {
// Something Here
}Since AndroidAnnotations 3.1
This annotation is intended to be used on methods to receive events defined by android.widget.TextView.OnEditorActionListener#onEditorAction(android.widget.TextView, int, android.view.KeyEvent) when an action is performed on the editor.
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 parameters:
The return type of the method can be either void or boolean. In case of boolean, the value returned from the annotated method will be returned in the generated listener method (indicating event consumption). If the annotated method is void, always true will be returned in the listener method (so the event is consumed).
Some usage examples of @EditorAction annotation:
@EditorAction(R.id.helloTextView)
void onEditorActionsOnHelloTextView(TextView hello, int actionId, KeyEvent keyEvent) {
// Something Here
}
@EditorAction
void helloTextViewEditorAction(TextView hello) {
// Something Here
}
@EditorAction({R.id.editText, R.id.helloTextView})
void onEditorActionsOnSomeTextViews(TextView tv, int actionId) {
// Something Here
}
@EditorAction(R.id.helloTextView)
void onEditorActionsOnHelloTextView() {
// Something Here
}
@EditorAction(R.id.helloTextView)
boolean onEditorActionsOnHelloTextView() {
// Something Here
return false;
}Since AndroidAnnotations 4.0.0
As of AndroidAnnotations 4.0.0 any subclass of TextView can be passed to the methods (eg. EditText).
| Back | FazBrowse Home | New Git URL |