Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.


interface OnScrollChangeListener

Interface definition for a callback to be invoked when the scroll X or Y positions of a view change.

This version of the interface works on all versions of Android, back to API v4.


Public methods

abstract Unit
onScrollChange(v: NestedScrollView!, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int)

Called when the scroll position of a view changes.

Public methods


abstract fun onScrollChange(v: NestedScrollView!, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int): Unit

Called when the scroll position of a view changes.

v NestedScrollView!: The view whose scroll position has changed.
scrollX NestedScrollView!: Current horizontal scroll origin.
scrollY NestedScrollView!: Current vertical scroll origin.
oldScrollX NestedScrollView!: Previous horizontal scroll origin.
oldScrollY NestedScrollView!: Previous vertical scroll origin.