# ScrollingView

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Methods](https://developer.android.com/reference/android/support/v4/view/ScrollingView#pubmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/view/ScrollingView#)  

# ScrollingView

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


interface
ScrollingView
`  
`


`

|---------------------------------------|
| android.support.v4.view.ScrollingView |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/view/ScrollingView#)Known Indirect Subclasses [BaseGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/BaseGridView),[HorizontalGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/HorizontalGridView),[NestedScrollView](https://developer.android.com/reference/android/support/v4/widget/NestedScrollView),[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView),[VerticalGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/VerticalGridView),[WearableRecyclerView](https://developer.android.com/reference/android/support/wear/widget/WearableRecyclerView) |----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [BaseGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/BaseGridView)             | An abstract base class for vertically and horizontally scrolling lists.                                                                                                                                                                                                                                                                                                        | | [HorizontalGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/HorizontalGridView) | A[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)that shows items in a horizontal scrolling list.                                                                                                                                                                                                                                              | | [NestedScrollView](https://developer.android.com/reference/android/support/v4/widget/NestedScrollView)               | NestedScrollView is just like[ScrollView](https://developer.android.com/reference/android/widget/ScrollView.html), but it supports acting as both a nested scrolling parent and child on both new and old versions of Android.                                                                                                                                                 | | [RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)                       | A flexible view for providing a limited window into a large data set.                                                                                                                                                                                                                                                                                                          | | [VerticalGridView](https://developer.android.com/reference/android/support/v17/leanback/widget/VerticalGridView)     | A[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)that shows items in a vertically scrolling list.                                                                                                                                                                                                                                              | | [WearableRecyclerView](https://developer.android.com/reference/android/support/wear/widget/WearableRecyclerView)     | Wearable specific implementation of the[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView)enabling[setCircularScrollingGestureEnabled(boolean)](https://developer.android.com/reference/android/support/wear/widget/WearableRecyclerView#setCircularScrollingGestureEnabled(boolean))circular scrolling} and semi-circular layouts. | ||

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                              ### Public methods                                                                                                                               ||
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract int` | ` `[computeHorizontalScrollExtent](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollExtent())`() ` <br /> Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. |
| ` abstract int` | ` `[computeHorizontalScrollOffset](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollOffset())`() ` <br /> Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. |
| ` abstract int` | ` `[computeHorizontalScrollRange](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollRange())`() ` <br /> Compute the horizontal range that the horizontal scrollbar represents.                           |
| ` abstract int` | ` `[computeVerticalScrollExtent](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollExtent())`() ` <br /> Compute the vertical extent of the vertical scrollbar's thumb within the vertical range.           |
| ` abstract int` | ` `[computeVerticalScrollOffset](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollOffset())`() ` <br /> Compute the vertical offset of the vertical scrollbar's thumb within the horizontal range.         |
| ` abstract int` | ` `[computeVerticalScrollRange](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollRange())`() ` <br /> Compute the vertical range that the vertical scrollbar represents.                                   |

## Public methods

### computeHorizontalScrollExtent

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeHorizontalScrollExtent ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollRange())and[computeHorizontalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollOffset()).

The default extent is the drawing width of this view.

<br />

<br />

|                           Returns                            ||
|-------|-------------------------------------------------------|
| `int` | the horizontal extent of the scrollbar's thumb <br /> |

**See also:**

- [computeHorizontalScrollRange()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollRange())
- [computeHorizontalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollOffset())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  

### computeHorizontalScrollOffset

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeHorizontalScrollOffset ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollRange())and[computeHorizontalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollExtent()).

The default offset is the scroll offset of this view.

<br />

<br />

|                           Returns                            ||
|-------|-------------------------------------------------------|
| `int` | the horizontal offset of the scrollbar's thumb <br /> |

**See also:**

- [computeHorizontalScrollRange()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollRange())
- [computeHorizontalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollExtent())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  

### computeHorizontalScrollRange

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeHorizontalScrollRange ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollExtent())and[computeHorizontalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollOffset()).

The default range is the drawing width of this view.

<br />

<br />

|                                     Returns                                      ||
|-------|---------------------------------------------------------------------------|
| `int` | the total horizontal range represented by the horizontal scrollbar <br /> |

**See also:**

- [computeHorizontalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollExtent())
- [computeHorizontalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeHorizontalScrollOffset())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  

### computeVerticalScrollExtent

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeVerticalScrollExtent ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollRange())and[computeVerticalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollOffset()).

The default extent is the drawing height of this view.

<br />

<br />

|                          Returns                           ||
|-------|-----------------------------------------------------|
| `int` | the vertical extent of the scrollbar's thumb <br /> |

**See also:**

- [computeVerticalScrollRange()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollRange())
- [computeVerticalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollOffset())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  

### computeVerticalScrollOffset

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeVerticalScrollOffset ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollRange())and[computeVerticalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollExtent()).

The default offset is the scroll offset of this view.

<br />

<br />

|                          Returns                           ||
|-------|-----------------------------------------------------|
| `int` | the vertical offset of the scrollbar's thumb <br /> |

**See also:**

- [computeVerticalScrollRange()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollRange())
- [computeVerticalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollExtent())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  

### computeVerticalScrollRange

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int computeVerticalScrollRange ()
```

<br />

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()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollExtent())and[computeVerticalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollOffset()).

<br />

<br />

|                                                              Returns                                                               ||
|-------|-----------------------------------------------------------------------------------------------------------------------------|
| `int` | the total vertical range represented by the vertical scrollbar The default range is the drawing height of this view. <br /> |

**See also:**

- [computeVerticalScrollExtent()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollExtent())
- [computeVerticalScrollOffset()](https://developer.android.com/reference/android/support/v4/view/ScrollingView#computeVerticalScrollOffset())
- [ERROR(/android.widget.ScrollBarDrawable)](https://developer.android.com/)  
-

  ## Annotations

  - [ViewPager.DecorView](https://developer.android.com/reference/android/support/v4/view/ViewPager.DecorView)
-

  ## Interfaces

  - [ActionProvider.VisibilityListener](https://developer.android.com/reference/android/support/v4/view/ActionProvider.VisibilityListener)
  - [AsyncLayoutInflater.OnInflateFinishedListener](https://developer.android.com/reference/android/support/v4/view/AsyncLayoutInflater.OnInflateFinishedListener)
  - [LayoutInflaterFactory](https://developer.android.com/reference/android/support/v4/view/LayoutInflaterFactory)
  - [MenuItemCompat.OnActionExpandListener](https://developer.android.com/reference/android/support/v4/view/MenuItemCompat.OnActionExpandListener)
  - [NestedScrollingChild](https://developer.android.com/reference/android/support/v4/view/NestedScrollingChild)
  - [NestedScrollingChild2](https://developer.android.com/reference/android/support/v4/view/NestedScrollingChild2)
  - [NestedScrollingParent](https://developer.android.com/reference/android/support/v4/view/NestedScrollingParent)
  - [NestedScrollingParent2](https://developer.android.com/reference/android/support/v4/view/NestedScrollingParent2)
  - [OnApplyWindowInsetsListener](https://developer.android.com/reference/android/support/v4/view/OnApplyWindowInsetsListener)
  - [ScrollingView](https://developer.android.com/reference/android/support/v4/view/ScrollingView)
  - [TintableBackgroundView](https://developer.android.com/reference/android/support/v4/view/TintableBackgroundView)
  - [ViewPager.OnAdapterChangeListener](https://developer.android.com/reference/android/support/v4/view/ViewPager.OnAdapterChangeListener)
  - [ViewPager.OnPageChangeListener](https://developer.android.com/reference/android/support/v4/view/ViewPager.OnPageChangeListener)
  - [ViewPager.PageTransformer](https://developer.android.com/reference/android/support/v4/view/ViewPager.PageTransformer)
  - [ViewPropertyAnimatorListener](https://developer.android.com/reference/android/support/v4/view/ViewPropertyAnimatorListener)
  - [ViewPropertyAnimatorUpdateListener](https://developer.android.com/reference/android/support/v4/view/ViewPropertyAnimatorUpdateListener)
-

  ## Classes

  - [AbsSavedState](https://developer.android.com/reference/android/support/v4/view/AbsSavedState)
  - [AccessibilityDelegateCompat](https://developer.android.com/reference/android/support/v4/view/AccessibilityDelegateCompat)
  - [ActionProvider](https://developer.android.com/reference/android/support/v4/view/ActionProvider)
  - [AsyncLayoutInflater](https://developer.android.com/reference/android/support/v4/view/AsyncLayoutInflater)
  - [GestureDetectorCompat](https://developer.android.com/reference/android/support/v4/view/GestureDetectorCompat)
  - [GravityCompat](https://developer.android.com/reference/android/support/v4/view/GravityCompat)
  - [InputDeviceCompat](https://developer.android.com/reference/android/support/v4/view/InputDeviceCompat)
  - [LayoutInflaterCompat](https://developer.android.com/reference/android/support/v4/view/LayoutInflaterCompat)
  - [MarginLayoutParamsCompat](https://developer.android.com/reference/android/support/v4/view/MarginLayoutParamsCompat)
  - [MenuCompat](https://developer.android.com/reference/android/support/v4/view/MenuCompat)
  - [MenuItemCompat](https://developer.android.com/reference/android/support/v4/view/MenuItemCompat)
  - [MotionEventCompat](https://developer.android.com/reference/android/support/v4/view/MotionEventCompat)
  - [NestedScrollingChildHelper](https://developer.android.com/reference/android/support/v4/view/NestedScrollingChildHelper)
  - [NestedScrollingParentHelper](https://developer.android.com/reference/android/support/v4/view/NestedScrollingParentHelper)
  - [PagerAdapter](https://developer.android.com/reference/android/support/v4/view/PagerAdapter)
  - [PagerTabStrip](https://developer.android.com/reference/android/support/v4/view/PagerTabStrip)
  - [PagerTitleStrip](https://developer.android.com/reference/android/support/v4/view/PagerTitleStrip)
  - [PointerIconCompat](https://developer.android.com/reference/android/support/v4/view/PointerIconCompat)
  - [ScaleGestureDetectorCompat](https://developer.android.com/reference/android/support/v4/view/ScaleGestureDetectorCompat)
  - [VelocityTrackerCompat](https://developer.android.com/reference/android/support/v4/view/VelocityTrackerCompat)
  - [ViewCompat](https://developer.android.com/reference/android/support/v4/view/ViewCompat)
  - [ViewConfigurationCompat](https://developer.android.com/reference/android/support/v4/view/ViewConfigurationCompat)
  - [ViewGroupCompat](https://developer.android.com/reference/android/support/v4/view/ViewGroupCompat)
  - [ViewPager](https://developer.android.com/reference/android/support/v4/view/ViewPager)
  - [ViewPager.LayoutParams](https://developer.android.com/reference/android/support/v4/view/ViewPager.LayoutParams)
  - [ViewPager.SavedState](https://developer.android.com/reference/android/support/v4/view/ViewPager.SavedState)
  - [ViewPager.SimpleOnPageChangeListener](https://developer.android.com/reference/android/support/v4/view/ViewPager.SimpleOnPageChangeListener)
  - [ViewParentCompat](https://developer.android.com/reference/android/support/v4/view/ViewParentCompat)
  - [ViewPropertyAnimatorCompat](https://developer.android.com/reference/android/support/v4/view/ViewPropertyAnimatorCompat)
  - [ViewPropertyAnimatorListenerAdapter](https://developer.android.com/reference/android/support/v4/view/ViewPropertyAnimatorListenerAdapter)
  - [WindowCompat](https://developer.android.com/reference/android/support/v4/view/WindowCompat)
  - [WindowInsetsCompat](https://developer.android.com/reference/android/support/v4/view/WindowInsetsCompat)