@Retention(value=CLASS)
@Target(value=METHOD)
public @interface FocusChange
This annotation is intended to be used on methods to receive events defined
by
View.OnFocusChangeListener.onFocusChange(android.view.View, boolean)
after focus is changed on the targeted View or subclass of View.
The annotation value should be one or several R.id.* fields that refers to View or subclasses of View. If not set, the method name will be used as the R.id.* field name.
The method MAY have multiple parameter:
View parameter to know which view has targeted
this eventboolean to know the view has focus.
Example :
@FocusChange(R.id.myButton)
void focusChangedOnMyButton(boolean isChecked, View button) {
// Something Here
}
@FocusChange
void myButtonFocusChanged(View button) {
// Something Here
}
@FocusChange({R.id.myButton, R.id.myButton1})
void focusChangedOnSomeButtons(View button, boolean isChecked) {
// Something Here
}
@FocusChange(R.id.myButton)
void focusChangedOnMyButton() {
// Something Here
}
Copyright © 2010-2014. All Rights Reserved.