Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
GridViewPager.OnPageChangeListener
android.support.wearable.view.GridViewPager.OnPageChangeListener
|
Known indirect subclasses
DotsPageIndicator |
This class is deprecated.
starting with Android Wear 2.0 we no longer encourage bi-directional spacial models
for apps. If you are looking to implement vertical paging pattern, consider using the SnapHelper and a RecyclerView
instead.
|
|
This interface is deprecated.
starting with Android Wear 2.0 we no longer encourage bi-directional spacial models
for apps. If you are looking to implement vertical paging pattern, consider using the
SnapHelper
and a RecyclerView
instead.
Callback interface for responding to changing state of the selected page.
Summary
Public methods |
abstract
void
|
onPageScrollStateChanged(int state)
Called when the scroll state changes.
|
abstract
void
|
onPageScrolled(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels)
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 row, int column)
This method is called when a new page becomes selected.
|
Public methods
onPageScrollStateChanged
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 |
int : The new scroll state. |
onPageScrolled
public abstract void onPageScrolled (int row,
int column,
float rowOffset,
float columnOffset,
int rowOffsetPixels,
int columnOffsetPixels)
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 |
row |
int : Vertical position index of the new selected page row position+1 will be visible if
positionOffset is nonzero |
column |
int : Horizontal position index of the new selected page |
rowOffset |
float : Value from [0, 1) indicating the offset from the row |
columnOffset |
float : Value from [0, 1) indicating the offset from the column |
rowOffsetPixels |
int : Value in pixels indicating the offset from row |
columnOffsetPixels |
int : Value in pixels indicating the offset from column
|
onPageSelected
public abstract void onPageSelected (int row,
int column)
This method is called when a new page becomes selected. The page may still be settling into
final position.
Parameters |
row |
int : Vertical position index of the new selected page |
column |
int : Horizontal position index of the new selected page
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# GridViewPager.OnPageChangeListener\n\nSummary: [Methods](#pubmethods) \n\nGridViewPager.OnPageChangeListener\n==================================\n\n\n`\npublic\nstatic\n\n\ninterface\nGridViewPager.OnPageChangeListener\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------------------------|\n| android.support.wearable.view.GridViewPager.OnPageChangeListener |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [DotsPageIndicator](../../../../../reference/android/support/wearable/view/DotsPageIndicator.html) |----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [DotsPageIndicator](../../../../../reference/android/support/wearable/view/DotsPageIndicator.html) | *This class is deprecated. starting with Android Wear 2.0 we no longer encourage bi-directional spacial models for apps. If you are looking to implement vertical paging pattern, consider using the [SnapHelper](../../../../../reference/android/support/v7/widget/SnapHelper.html) and a [RecyclerView](../../../../../reference/android/support/v7/widget/RecyclerView.html) instead.* | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface is deprecated.** \n\nstarting with Android Wear 2.0 we no longer encourage bi-directional spacial models\nfor apps. If you are looking to implement vertical paging pattern, consider using the\n[SnapHelper](../../../../../reference/android/support/v7/widget/SnapHelper.html) and a [RecyclerView](../../../../../reference/android/support/v7/widget/RecyclerView.html) instead.\n\nCallback interface for responding to changing state of the selected page.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onPageScrollStateChanged](../../../../../reference/android/support/wearable/view/GridViewPager.OnPageChangeListener.html#onPageScrollStateChanged(int))`(int state) ` Called when the scroll state changes. |\n| ` abstract void` | ` `[onPageScrolled](../../../../../reference/android/support/wearable/view/GridViewPager.OnPageChangeListener.html#onPageScrolled(int,%20int,%20float,%20float,%20int,%20int))`(int row, int column, float rowOffset, float columnOffset, int rowOffsetPixels, int columnOffsetPixels) ` 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. |\n| ` abstract void` | ` `[onPageSelected](../../../../../reference/android/support/wearable/view/GridViewPager.OnPageChangeListener.html#onPageSelected(int,%20int))`(int row, int column) ` This method is called when a new page becomes selected. |\n\nPublic methods\n--------------\n\n### onPageScrollStateChanged\n\n```\npublic abstract void onPageScrollStateChanged (int state)\n```\n\nCalled when the scroll state changes. Useful for discovering when the user begins dragging,\nwhen the pager is automatically settling to the current page, or when it is fully\nstopped/idle.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-------------------------------------|\n| `state` | `int`: The new scroll state. \u003cbr /\u003e |\n\n**See also:**\n\n- [GridViewPager.SCROLL_STATE_IDLE](../../../../../reference/android/support/wearable/view/GridViewPager.html#SCROLL_STATE_IDLE)\n- [GridViewPager.SCROLL_STATE_DRAGGING](../../../../../reference/android/support/wearable/view/GridViewPager.html#SCROLL_STATE_DRAGGING)\n- [GridViewPager.SCROLL_STATE_SETTLING](../../../../../reference/android/support/wearable/view/GridViewPager.html#SCROLL_STATE_SETTLING) \n\n### onPageScrolled\n\n```\npublic abstract void onPageScrolled (int row, \n int column, \n float rowOffset, \n float columnOffset, \n int rowOffsetPixels, \n int columnOffsetPixels)\n```\n\nThis method will be invoked when the current page is scrolled, either as part of a\nprogrammatically initiated smooth scroll or a user initiated touch scroll.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------------|----------------------------------------------------------------------------------------------------------------------------|\n| `row` | `int`: Vertical position index of the new selected page row position+1 will be visible if positionOffset is nonzero \u003cbr /\u003e |\n| `column` | `int`: Horizontal position index of the new selected page \u003cbr /\u003e |\n| `rowOffset` | `float`: Value from \\[0, 1) indicating the offset from the row \u003cbr /\u003e |\n| `columnOffset` | `float`: Value from \\[0, 1) indicating the offset from the column \u003cbr /\u003e |\n| `rowOffsetPixels` | `int`: Value in pixels indicating the offset from row \u003cbr /\u003e |\n| `columnOffsetPixels` | `int`: Value in pixels indicating the offset from column \u003cbr /\u003e |\n\n### onPageSelected\n\n```\npublic abstract void onPageSelected (int row, \n int column)\n```\n\nThis method is called when a new page becomes selected. The page may still be settling into\nfinal position.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------------------------------------------------|\n| `row` | `int`: Vertical position index of the new selected page \u003cbr /\u003e |\n| `column` | `int`: Horizontal position index of the new selected page \u003cbr /\u003e |"]]