@Target(value=METHOD)
@Retention(value=CLASS)
public @interface OnPageChange
OnPageChangeListener on the view for each ID specified.
@OnPageChange(R.id.example_pager) void onPageSelected(int position) {
Toast.makeText(this, "Selected " + position + "!", LENGTH_SHORT).show();
}
Any number of parameters from onPageSelected may be used on the method.
To bind to methods other than onPageSelected, specify a different callback.
@OnPageChange(value = R.id.example_pager, callback = PAGE_SCROLL_STATE_CHANGED)
void onPageStateChanged(int state) {
Toast.makeText(this, "State changed: " + state + "!", LENGTH_SHORT).show();
}
Optional| Modifier and Type | Required Element and Description |
|---|---|
int[] |
value
View IDs to which the method will be bound.
|
| Modifier and Type | Optional Element and Description |
|---|---|
OnPageChange.Callback |
callback
Listener callback to which the method will be bound.
|
public abstract OnPageChange.Callback callback
Copyright © 2013-2014. All Rights Reserved.