ScrollingView

interface ScrollingView
androidx.core.view.ScrollingView

An interface that can be implemented by Views to provide scroll related APIs.

Summary

Public methods

abstract Int

Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range.

abstract Int

Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range.

abstract Int

Compute the horizontal range that the horizontal scrollbar represents.

abstract Int

Compute the vertical extent of the vertical scrollbar's thumb within the vertical range.

abstract Int

Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range.

abstract Int

Compute the vertical range that the vertical scrollbar represents.

Public methods

computeHorizontalScrollExtent

abstract fun computeHorizontalScrollExtent(): Int

Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the length of the thumb within the scrollbar's track.

The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollRange() and computeHorizontalScrollOffset().

The default extent is the drawing width of this view.

Return
Int: the horizontal extent of the scrollbar's thumb

computeHorizontalScrollOffset

abstract fun computeHorizontalScrollOffset(): Int

Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the position of the thumb within the scrollbar's track.

The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollRange() and computeHorizontalScrollExtent().

The default offset is the scroll offset of this view.

Return
Int: the horizontal offset of the scrollbar's thumb

computeHorizontalScrollRange

abstract fun computeHorizontalScrollRange(): Int

Compute the horizontal range that the horizontal scrollbar represents.

The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollExtent() and computeHorizontalScrollOffset().

The default range is the drawing width of this view.

Return
Int: the total horizontal range represented by the horizontal scrollbar

computeVerticalScrollExtent

abstract fun computeVerticalScrollExtent(): Int

Compute the vertical extent of the vertical scrollbar's thumb within the vertical range. This value is used to compute the length of the thumb within the scrollbar's track.

The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollRange() and computeVerticalScrollOffset().

The default extent is the drawing height of this view.

Return
Int: the vertical extent of the scrollbar's thumb

computeVerticalScrollOffset

abstract fun computeVerticalScrollOffset(): Int

Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range. This value is used to compute the position of the thumb within the scrollbar's track.

The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollRange() and computeVerticalScrollExtent().

The default offset is the scroll offset of this view.

Return
Int: the vertical offset of the scrollbar's thumb

computeVerticalScrollRange

abstract fun computeVerticalScrollRange(): Int

Compute the vertical range that the vertical scrollbar represents.

The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollExtent() and computeVerticalScrollOffset().

Return
Int: the total vertical range represented by the vertical scrollbar

The default range is the drawing height of this view.