类概述
回调响应变化状态选择页面调用的接口
Summary
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
onPageScrollStateChanged(int state)
Called when the scroll state changes.
滚动状态修改时调用
| ||||||||||
abstract void |
onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
滚动过程调用
This method will be invoked when the current page is scrolled, either as part of a programmatically initiated smooth scroll or a user initiated touch scroll.
| ||||||||||
abstract void |
onPageSelected(int position)
This method will be invoked when a new page becomes selected.
当新的页面成为新的选择成功时候调用
|
Public Methods
public abstract void onPageScrollStateChanged (int state)
Called when the scroll state changes. Useful for discovering when the user begins dragging, when the pager is automatically settling to the current page, or when it is fully stopped/idle.
Parameters
state | The new scroll state. |
---|
See Also
SCROLL_STATE_IDLEIndicates that the pager is in an idle, settled state.
[安定的状态。当前页面是完全在视图内且没有动画正在进行中。]
Constant Value: 0 (0x00000000)
SCROLL_STATE_DRAGGINGndicates that the pager is currently being dragged by the user.
[ pager处于正在拖拽中]
Constant Value: 1 (0x00000001)
SCROLL_STATE_SETTLINGIndicates that the pager is in the process of settling to a final position.
[pager正在自动沉降,相当于松手后,pager恢复到一个完整pager的过程 ]
Constant Value: 2 (0x00000002)
public abstract void onPageScrolled (int position, float positionOffset, int positionOffsetPixels)
This method will be invoked when the current page is scrolled, either as part of a programmatically initiated smooth scroll or a user initiated touch scroll.
滚动时候被调用
Parameters
position | Position index of the first page currently being displayed. Page position+1 will be visible if positionOffset is nonzero. 目前显示的第一个页面 |
---|---|
positionOffset | Value from [0, 1) indicating the offset from the page at position. 值(0,1)表示页面位置的偏移。 |
positionOffsetPixels | Value in pixels indicating the offset from position. 偏移的像素点 |
public abstract void onPageSelected (int position)
This method will be invoked when a new page becomes selected. Animation is not necessarily complete.
一个新页被调用时执行,仍为原来的page时,该方法不被调用
Parameters
position | Position index of the new selected page. |
---|