public static interface PageSlider.PageChangedListener
This interface is triggered when the selected page is changed.
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onPageChosen(int itemPos) |
Called back when a new page is chosen.
|
void |
onPageSlideStateChanged(int state) |
Called when the page slide state is changed.
|
void |
onPageSliding(int itemPos,
float itemPosOffset,
int itemPosOffsetPixels) |
Called when the page is sliding.
|
void onPageSliding(int itemPos,
float itemPosOffset,
int itemPosOffsetPixels)
itemPos - Indicates the position index of the displayed page.itemPosOffset - Indicates the position offset of the page. The value range is (0, 1].
0 indicates that the same page is being displayed;
1 indicates that the target page is being displayed.itemPosOffsetPixels - Indicates the number of position offset pixels of the displayed page.void onPageSlideStateChanged(int state)
state - Indicates the page state. The value can be 0, 1, or 2,
representing that the page is in idle, dragged, or sliding state, respectively.void onPageChosen(int itemPos)
itemPos - Indicates the index of the chosen page.