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,["# NestedScrollView.OnScrollChangeListener\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1 \n\nNestedScrollView.OnScrollChangeListener\n=======================================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\nstatic\n\n\ninterface\nNestedScrollView.OnScrollChangeListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------------------|\n| android.support.v4.widget.NestedScrollView.OnScrollChangeListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when the scroll\nX or Y positions of a view change.\n\nThis version of the interface works on all versions of Android, back to API v4.\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [setOnScrollChangeListener(OnScrollChangeListener)](/reference/android/support/v4/widget/NestedScrollView#setOnScrollChangeListener(android.support.v4.widget.NestedScrollView.OnScrollChangeListener))\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onScrollChange](/reference/android/support/v4/widget/NestedScrollView.OnScrollChangeListener#onScrollChange(android.support.v4.widget.NestedScrollView, int, int, int, int))`(`[NestedScrollView](/reference/android/support/v4/widget/NestedScrollView)` v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) ` Called when the scroll position of a view changes. |\n\nPublic methods\n--------------\n\n### onScrollChange\n\nadded in [version 24.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid onScrollChange (NestedScrollView v, \n int scrollX, \n int scrollY, \n int oldScrollX, \n int oldScrollY)\n```\n\nCalled when the scroll position of a view changes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------|\n| `v` | `NestedScrollView`: The view whose scroll position has changed. \u003cbr /\u003e |\n| `scrollX` | `int`: Current horizontal scroll origin. \u003cbr /\u003e |\n| `scrollY` | `int`: Current vertical scroll origin. \u003cbr /\u003e |\n| `oldScrollX` | `int`: Previous horizontal scroll origin. \u003cbr /\u003e |\n| `oldScrollY` | `int`: Previous vertical scroll origin. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [DrawerLayout.DrawerListener](/reference/android/support/v4/widget/DrawerLayout.DrawerListener)\n - [NestedScrollView.OnScrollChangeListener](/reference/android/support/v4/widget/NestedScrollView.OnScrollChangeListener)\n - [SimpleCursorAdapter.CursorToStringConverter](/reference/android/support/v4/widget/SimpleCursorAdapter.CursorToStringConverter)\n - [SimpleCursorAdapter.ViewBinder](/reference/android/support/v4/widget/SimpleCursorAdapter.ViewBinder)\n - [SlidingPaneLayout.PanelSlideListener](/reference/android/support/v4/widget/SlidingPaneLayout.PanelSlideListener)\n - [SwipeRefreshLayout.OnChildScrollUpCallback](/reference/android/support/v4/widget/SwipeRefreshLayout.OnChildScrollUpCallback)\n - [SwipeRefreshLayout.OnRefreshListener](/reference/android/support/v4/widget/SwipeRefreshLayout.OnRefreshListener)\n - [TintableCompoundButton](/reference/android/support/v4/widget/TintableCompoundButton)\n-\n\n Classes\n -------\n\n - [AutoScrollHelper](/reference/android/support/v4/widget/AutoScrollHelper)\n - [CircularProgressDrawable](/reference/android/support/v4/widget/CircularProgressDrawable)\n - [CompoundButtonCompat](/reference/android/support/v4/widget/CompoundButtonCompat)\n - [ContentLoadingProgressBar](/reference/android/support/v4/widget/ContentLoadingProgressBar)\n - [CursorAdapter](/reference/android/support/v4/widget/CursorAdapter)\n - [DrawerLayout](/reference/android/support/v4/widget/DrawerLayout)\n - [DrawerLayout.LayoutParams](/reference/android/support/v4/widget/DrawerLayout.LayoutParams)\n - [DrawerLayout.SavedState](/reference/android/support/v4/widget/DrawerLayout.SavedState)\n - [DrawerLayout.SimpleDrawerListener](/reference/android/support/v4/widget/DrawerLayout.SimpleDrawerListener)\n - [EdgeEffectCompat](/reference/android/support/v4/widget/EdgeEffectCompat)\n - [ExploreByTouchHelper](/reference/android/support/v4/widget/ExploreByTouchHelper)\n - [ImageViewCompat](/reference/android/support/v4/widget/ImageViewCompat)\n - [ListPopupWindowCompat](/reference/android/support/v4/widget/ListPopupWindowCompat)\n - [ListViewAutoScrollHelper](/reference/android/support/v4/widget/ListViewAutoScrollHelper)\n - [ListViewCompat](/reference/android/support/v4/widget/ListViewCompat)\n - [NestedScrollView](/reference/android/support/v4/widget/NestedScrollView)\n - [PopupMenuCompat](/reference/android/support/v4/widget/PopupMenuCompat)\n - [PopupWindowCompat](/reference/android/support/v4/widget/PopupWindowCompat)\n - [ResourceCursorAdapter](/reference/android/support/v4/widget/ResourceCursorAdapter)\n - [ScrollerCompat](/reference/android/support/v4/widget/ScrollerCompat)\n - [SimpleCursorAdapter](/reference/android/support/v4/widget/SimpleCursorAdapter)\n - [SlidingPaneLayout](/reference/android/support/v4/widget/SlidingPaneLayout)\n - [SlidingPaneLayout.LayoutParams](/reference/android/support/v4/widget/SlidingPaneLayout.LayoutParams)\n - [SlidingPaneLayout.SimplePanelSlideListener](/reference/android/support/v4/widget/SlidingPaneLayout.SimplePanelSlideListener)\n - [Space](/reference/android/support/v4/widget/Space)\n - [SwipeRefreshLayout](/reference/android/support/v4/widget/SwipeRefreshLayout)\n - [TextViewCompat](/reference/android/support/v4/widget/TextViewCompat)\n - [ViewDragHelper](/reference/android/support/v4/widget/ViewDragHelper)\n - [ViewDragHelper.Callback](/reference/android/support/v4/widget/ViewDragHelper.Callback)"]]