# AutoScrollHelper

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:[Constants](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#constants)\|[Ctors](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#)  

# AutoScrollHelper

| 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


abstract
class
AutoScrollHelper
`  
`

extends Object


``


implements

`[View.OnTouchListener](https://developer.android.com/reference/android/view/View.OnTouchListener.html)`


`

|---|--------------------------------------------|
| java.lang.Object                              ||
| ↳ | android.support.v4.widget.AutoScrollHelper |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#)Known Direct Subclasses [ListViewAutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/ListViewAutoScrollHelper) |------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ListViewAutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/ListViewAutoScrollHelper) | An implementation of[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper)that knows how to scroll through a[ListView](https://developer.android.com/reference/android/widget/ListView.html). | |

<br />

*** ** * ** ***

AutoScrollHelper is a utility class for adding automatic edge-triggered scrolling to Views.

**Note:** Implementing classes are responsible for overriding the[scrollTargetBy(int, int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#scrollTargetBy(int, int)),[canTargetScrollHorizontally(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#canTargetScrollHorizontally(int)), and[canTargetScrollVertically(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#canTargetScrollVertically(int))methods. See[ListViewAutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/ListViewAutoScrollHelper)for a[ListView](https://developer.android.com/reference/android/widget/ListView.html)-specific implementation.

<br />

# Activation

| 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).
Automatic scrolling starts when the user touches within an activation area. By default, activation areas are defined as the top, left, right, and bottom 20% of the host view's total area. Touching within the top activation area scrolls up, left scrolls to the left, and so on.

As the user touches closer to the extreme edge of the activation area, scrolling accelerates up to a maximum velocity. When using the default edge type,[EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND), moving outside of the view bounds will scroll at the maximum velocity.

The following activation properties may be configured:

- Delay after entering activation area before auto-scrolling begins, see[setActivationDelay(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setActivationDelay(int)). Default value is[getTapTimeout()](https://developer.android.com/reference/android/view/ViewConfiguration.html#getTapTimeout())to avoid conflicting with taps.
- Location of activation areas, see[setEdgeType(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEdgeType(int)). Default value is[EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND).
- Size of activation areas relative to view size, see[setRelativeEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeEdges(float, float)). Default value is 20% for both vertical and horizontal edges.
- Maximum size used to constrain relative size, see[setMaximumEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float)). Default value is[NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX).

# Scrolling

| 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).
When automatic scrolling is active, the helper will repeatedly call[scrollTargetBy(int, int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#scrollTargetBy(int, int))to apply new scrolling offsets.

The following scrolling properties may be configured:

- Acceleration ramp-up duration, see[setRampUpDuration(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRampUpDuration(int)). Default value is 500 milliseconds.
- Acceleration ramp-down duration, see[setRampDownDuration(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRampDownDuration(int)). Default value is 500 milliseconds.
- Target velocity relative to view size, see[setRelativeVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeVelocity(float, float)). Default value is 100% per second for both vertical and horizontal.
- Minimum velocity used to constrain relative velocity, see[setMinimumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float)). When set, scrolling will accelerate to the larger of either this value or the relative target value. Default value is approximately 5 centimeters or 315 dips per second.
- Maximum velocity used to constrain relative velocity, see[setMaximumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float)). Default value is approximately 25 centimeters or 1575 dips per second.

<br />

## Summary

|                                                                                                                                                                                                                                                                                              ### Constants                                                                                                                                                                                                                                                                                              ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int`   | [EDGE_TYPE_INSIDE](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE) Edge type that specifies an activation area starting at the view bounds and extending inward.                                                                                                                                                                                                                                                                                                                                                                          |
| `int`   | [EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND) Edge type that specifies an activation area starting at the view bounds and extending inward.                                                                                                                                                                                                                                                                                                                                                            |
| `int`   | [EDGE_TYPE_OUTSIDE](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_OUTSIDE) Edge type that specifies an activation area starting at the view bounds and extending outward.                                                                                                                                                                                                                                                                                                                                                                       |
| `float` | [NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX) Constant passed to[setMaximumEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float)),[setMaximumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float)), or[setMinimumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float)).    |
| `float` | [NO_MIN](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MIN) Constant passed to[setMaximumEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float)), or[setMaximumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float)), or[setMinimumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float)). |
| `float` | [RELATIVE_UNSPECIFIED](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED) Constant passed to[setRelativeEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeEdges(float, float))or[setRelativeVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeVelocity(float, float)).                                                                                                                              |

|                                                                                                                                      ### Public constructors                                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#AutoScrollHelper(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View.html)` target) ` Creates a new helper for scrolling the specified target view. |

|                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean`                                                                                       | ` `[canTargetScrollHorizontally](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#canTargetScrollHorizontally(int))`(int direction) ` Override this method to return whether the target view can be scrolled horizontally in a certain direction.                                                                                                                                                |
| ` abstract boolean`                                                                                       | ` `[canTargetScrollVertically](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#canTargetScrollVertically(int))`(int direction) ` Override this method to return whether the target view can be scrolled vertically in a certain direction.                                                                                                                                                      |
| ` boolean`                                                                                                | ` `[isEnabled](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#isEnabled())`() `                                                                                                                                                                                                                                                                                                                |
| ` boolean`                                                                                                | ` `[isExclusive](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#isExclusive())`() ` Indicates whether the scroll helper handles touch events exclusively during scrolling.                                                                                                                                                                                                                     |
| ` boolean`                                                                                                | ` `[onTouch](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#onTouch(android.view.View, android.view.MotionEvent))`(`[View](https://developer.android.com/reference/android/view/View.html)` v, `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)` event) ` Handles touch events by activating automatic scrolling, adjusting scroll velocity, or stopping. |
| ` abstract void`                                                                                          | ` `[scrollTargetBy](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#scrollTargetBy(int, int))`(int deltaX, int deltaY) ` Override this method to scroll the target view by the specified number of pixels.                                                                                                                                                                                      |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setActivationDelay](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setActivationDelay(int))`(int delayMillis) ` Sets the delay after entering an activation edge before activation of auto-scrolling.                                                                                                                                                                                      |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setEdgeType](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEdgeType(int))`(int type) ` Sets the activation edge type, one of: - [EDGE_TYPE_INSIDE](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE)for edges that respond to touches inside the bounds of the host view. <br />                                                    |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setEnabled](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEnabled(boolean))`(boolean enabled) ` Sets whether the scroll helper is enabled and should respond to touch events.                                                                                                                                                                                                          |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setExclusive](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setExclusive(boolean))`(boolean exclusive) ` Enables or disables exclusive handling of touch events during scrolling.                                                                                                                                                                                                         |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setMaximumEdges](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float))`(float horizontalMax, float verticalMax) ` Sets the absolute maximum edge size.                                                                                                                                                                                                             |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setMaximumVelocity](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float))`(float horizontalMax, float verticalMax) ` Sets the absolute maximum scrolling velocity.                                                                                                                                                                                              |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setMinimumVelocity](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float))`(float horizontalMin, float verticalMin) ` Sets the absolute minimum scrolling velocity.                                                                                                                                                                                              |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setRampDownDuration](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRampDownDuration(int))`(int durationMillis) ` Sets the amount of time after de-activation of auto-scrolling that is takes to slow to a stop.                                                                                                                                                                        |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setRampUpDuration](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRampUpDuration(int))`(int durationMillis) ` Sets the amount of time after activation of auto-scrolling that is takes to reach target velocity for the current touch position.                                                                                                                                         |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setRelativeEdges](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeEdges(float, float))`(float horizontal, float vertical) ` Sets the activation edge size relative to the host view's dimensions.                                                                                                                                                                                |
| ` `[AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | ` `[setRelativeVelocity](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeVelocity(float, float))`(float horizontal, float vertical) ` Sets the target scrolling velocity relative to the host view's dimensions.                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#)From interface` `[android.view.View.OnTouchListener](https://developer.android.com/reference/android/view/View.OnTouchListener.html)` ` |---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean` | ` onTouch(`[View](https://developer.android.com/reference/android/view/View.html)` arg0, `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)` arg1) ` | ||

## Constants

### EDGE_TYPE_INSIDE

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

```
int EDGE_TYPE_INSIDE
```

Edge type that specifies an activation area starting at the view bounds and extending inward. Moving outside the view bounds will stop scrolling.

<br />

**See also:**

- [setEdgeType(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEdgeType(int))

Constant Value: 0 (0x00000000)  

### EDGE_TYPE_INSIDE_EXTEND

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

```
int EDGE_TYPE_INSIDE_EXTEND
```

Edge type that specifies an activation area starting at the view bounds and extending inward. After activation begins, moving outside the view bounds will continue scrolling.

<br />

**See also:**

- [setEdgeType(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEdgeType(int))

Constant Value: 1 (0x00000001)  

### EDGE_TYPE_OUTSIDE

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

```
int EDGE_TYPE_OUTSIDE
```

Edge type that specifies an activation area starting at the view bounds and extending outward. Moving inside the view bounds will stop scrolling.

<br />

**See also:**

- [setEdgeType(int)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEdgeType(int))

Constant Value: 2 (0x00000002)  

### NO_MAX

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

```
float NO_MAX
```

Constant passed to[setMaximumEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float)),[setMaximumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float)), or[setMinimumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float)). Using this value ensures that the computed relative value is always used without constraining to a particular minimum or maximum value.

<br />

Constant Value: 3.4028235E38  

### NO_MIN

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

```
float NO_MIN
```

Constant passed to[setMaximumEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumEdges(float, float)), or[setMaximumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMaximumVelocity(float, float)), or[setMinimumVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setMinimumVelocity(float, float)). Using this value ensures that the computed relative value is always used without constraining to a particular minimum or maximum value.

<br />

Constant Value: 0.0  

### RELATIVE_UNSPECIFIED

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

```
float RELATIVE_UNSPECIFIED
```

Constant passed to[setRelativeEdges(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeEdges(float, float))or[setRelativeVelocity(float, float)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setRelativeVelocity(float, float)). Using this value ensures that the computed relative value is ignored and the absolute maximum value is always used.

<br />

Constant Value: 0.0

## Public constructors

### AutoScrollHelper

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

```
AutoScrollHelper (View target)
```

Creates a new helper for scrolling the specified target view.

The resulting helper may be configured by chaining setter calls and should be set as a touch listener on the target view.

By default, the helper is disabled and will not respond to touch events until it is enabled using[setEnabled(boolean)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setEnabled(boolean)).

<br />

|                         Parameters                         ||
|----------|--------------------------------------------------|
| `target` | `View`: The view to automatically scroll. <br /> |

## Public methods

### canTargetScrollHorizontally

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

```
boolean canTargetScrollHorizontally (int direction)
```

Override this method to return whether the target view can be scrolled horizontally in a certain direction.

<br />

|                                           Parameters                                            ||
|-------------|------------------------------------------------------------------------------------|
| `direction` | `int`: Negative to check scrolling left, positive to check scrolling right. <br /> |

|                                               Returns                                                ||
|-----------|-------------------------------------------------------------------------------------------|
| `boolean` | true if the target view is able to horizontally scroll in the specified direction. <br /> |

### canTargetScrollVertically

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

```
boolean canTargetScrollVertically (int direction)
```

Override this method to return whether the target view can be scrolled vertically in a certain direction.

<br />

|                                          Parameters                                          ||
|-------------|---------------------------------------------------------------------------------|
| `direction` | `int`: Negative to check scrolling up, positive to check scrolling down. <br /> |

|                                              Returns                                               ||
|-----------|-----------------------------------------------------------------------------------------|
| `boolean` | true if the target view is able to vertically scroll in the specified direction. <br /> |

### isEnabled

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

```
boolean isEnabled ()
```

<br />

<br />

|                                     Returns                                      ||
|-----------|-----------------------------------------------------------------------|
| `boolean` | True if this helper is enabled and responding to touch events. <br /> |

### isExclusive

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

```
boolean isExclusive ()
```

Indicates whether the scroll helper handles touch events exclusively during scrolling.

<br />

|                                                  Returns                                                   ||
|-----------|-------------------------------------------------------------------------------------------------|
| `boolean` | True if exclusive handling of touch events during scrolling is enabled, false otherwise. <br /> |

**See also:**

- [setExclusive(boolean)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#setExclusive(boolean))  

### onTouch

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

```
boolean onTouch (View v, 
                MotionEvent event)
```

Handles touch events by activating automatic scrolling, adjusting scroll velocity, or stopping.

If[isExclusive()](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#isExclusive())is false, always returns false so that the host view may handle touch events. Otherwise, returns true when automatic scrolling is active and false otherwise.

<br />

|          Parameters           ||
|---------|----------------------|
| `v`     | `View` <br />        |
| `event` | `MotionEvent` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### scrollTargetBy

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

```
void scrollTargetBy (int deltaX, 
                int deltaY)
```

Override this method to scroll the target view by the specified number of pixels.

<br />

|                               Parameters                                ||
|----------|---------------------------------------------------------------|
| `deltaX` | `int`: The number of pixels to scroll by horizontally. <br /> |
| `deltaY` | `int`: The number of pixels to scroll by vertically. <br />   |

### setActivationDelay

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

```
AutoScrollHelper setActivationDelay (int delayMillis)
```

Sets the delay after entering an activation edge before activation of auto-scrolling. By default, the activation delay is set to[getTapTimeout()](https://developer.android.com/reference/android/view/ViewConfiguration.html#getTapTimeout()).

Specifying a delay of zero will start auto-scrolling immediately after the touch position enters an activation edge.

<br />

|                             Parameters                             ||
|---------------|-----------------------------------------------------|
| `delayMillis` | `int`: The activation delay in milliseconds. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setEdgeType

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

```
AutoScrollHelper setEdgeType (int type)
```

Sets the activation edge type, one of:

- [EDGE_TYPE_INSIDE](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE)for edges that respond to touches inside the bounds of the host view. If touch moves outside the bounds, scrolling will stop.
- [EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND)for inside edges that continued to scroll when touch moves outside the bounds of the host view.
- [EDGE_TYPE_OUTSIDE](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#EDGE_TYPE_OUTSIDE)for edges that only respond to touches that move outside the bounds of the host view.

<br />

<br />

|                   Parameters                   ||
|--------|----------------------------------------|
| `type` | `int`: The type of edge to use. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setEnabled

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

```
AutoScrollHelper setEnabled (boolean enabled)
```

Sets whether the scroll helper is enabled and should respond to touch events.

<br />

|                             Parameters                             ||
|-----------|---------------------------------------------------------|
| `enabled` | `boolean`: Whether the scroll helper is enabled. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setExclusive

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

```
AutoScrollHelper setExclusive (boolean exclusive)
```

Enables or disables exclusive handling of touch events during scrolling. By default, exclusive handling is disabled and the target view receives all touch events.

When enabled,[onTouch(View, MotionEvent)](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#onTouch(android.view.View, android.view.MotionEvent))will return true if the helper is currently scrolling and false otherwise.

<br />

|                                                                      Parameters                                                                      ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `exclusive` | `boolean`: True to exclusively handle touch events during scrolling, false to allow the target view to receive all touch events. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setMaximumEdges

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

```
AutoScrollHelper setMaximumEdges (float horizontalMax, 
                float verticalMax)
```

Sets the absolute maximum edge size.

If relative edge size is not specified, activation edges will always be the maximum edge size. If both relative and maximum edges are specified, the maximum edge will be used to constrain the calculated relative edge size.

<br />

|                                                                                                              Parameters                                                                                                               ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMax` | `float`: The maximum horizontal edge size in pixels, or[NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX)to use the unconstrained calculated relative value. <br /> |
| `verticalMax`   | `float`: The maximum vertical edge size in pixels, or[NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX)to use the unconstrained calculated relative value. <br />   |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setMaximumVelocity

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

```
AutoScrollHelper setMaximumVelocity (float horizontalMax, 
                float verticalMax)
```

Sets the absolute maximum scrolling velocity.

If relative velocity is not specified, scrolling will always reach the same maximum velocity. If both relative and maximum velocities are specified, the maximum velocity will be used to clamp the calculated relative velocity.

<br />

|                                                                                                         Parameters                                                                                                          ||
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMax` | `float`: The maximum horizontal scrolling velocity, or[NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX)to leave the relative value unconstrained. <br /> |
| `verticalMax`   | `float`: The maximum vertical scrolling velocity, or[NO_MAX](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MAX)to leave the relative value unconstrained. <br />   |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setMinimumVelocity

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

```
AutoScrollHelper setMinimumVelocity (float horizontalMin, 
                float verticalMin)
```

Sets the absolute minimum scrolling velocity.

If both relative and minimum velocities are specified, the minimum velocity will be used to clamp the calculated relative velocity.

<br />

|                                                                                                         Parameters                                                                                                          ||
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMin` | `float`: The minimum horizontal scrolling velocity, or[NO_MIN](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MIN)to leave the relative value unconstrained. <br /> |
| `verticalMin`   | `float`: The minimum vertical scrolling velocity, or[NO_MIN](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#NO_MIN)to leave the relative value unconstrained. <br />   |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setRampDownDuration

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

```
AutoScrollHelper setRampDownDuration (int durationMillis)
```

Sets the amount of time after de-activation of auto-scrolling that is takes to slow to a stop.

Specifying a duration greater than zero prevents sudden jumps in velocity.

<br />

|                               Parameters                                ||
|------------------|-------------------------------------------------------|
| `durationMillis` | `int`: The ramp-down duration in milliseconds. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setRampUpDuration

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

```
AutoScrollHelper setRampUpDuration (int durationMillis)
```

Sets the amount of time after activation of auto-scrolling that is takes to reach target velocity for the current touch position.

Specifying a duration greater than zero prevents sudden jumps in velocity.

<br />

|                              Parameters                               ||
|------------------|-----------------------------------------------------|
| `durationMillis` | `int`: The ramp-up duration in milliseconds. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setRelativeEdges

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

```
AutoScrollHelper setRelativeEdges (float horizontal, 
                float vertical)
```

Sets the activation edge size relative to the host view's dimensions.

If both relative and maximum edges are specified, the maximum edge will be used to constrain the calculated relative edge size.

<br />

|                                                                                                                           Parameters                                                                                                                           ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontal` | `float`: The horizontal edge size as a fraction of the host view width, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED)to always use the maximum value. <br /> |
| `vertical`   | `float`: The vertical edge size as a fraction of the host view height, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED)to always use the maximum value. <br />  |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

### setRelativeVelocity

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

```
AutoScrollHelper setRelativeVelocity (float horizontal, 
                float vertical)
```

Sets the target scrolling velocity relative to the host view's dimensions.

If both relative and maximum velocities are specified, the maximum velocity will be used to clamp the calculated relative velocity.

<br />

|                                                                                                                        Parameters                                                                                                                         ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontal` | `float`: The target horizontal velocity as a fraction of the host view width per second, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED)to ignore. <br /> |
| `vertical`   | `float`: The target vertical velocity as a fraction of the host view height per second, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED)to ignore. <br />  |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. <br /> |

-

  ## Interfaces

  - [DrawerLayout.DrawerListener](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.DrawerListener)
  - [NestedScrollView.OnScrollChangeListener](https://developer.android.com/reference/android/support/v4/widget/NestedScrollView.OnScrollChangeListener)
  - [SimpleCursorAdapter.CursorToStringConverter](https://developer.android.com/reference/android/support/v4/widget/SimpleCursorAdapter.CursorToStringConverter)
  - [SimpleCursorAdapter.ViewBinder](https://developer.android.com/reference/android/support/v4/widget/SimpleCursorAdapter.ViewBinder)
  - [SlidingPaneLayout.PanelSlideListener](https://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.PanelSlideListener)
  - [SwipeRefreshLayout.OnChildScrollUpCallback](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.OnChildScrollUpCallback)
  - [SwipeRefreshLayout.OnRefreshListener](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.OnRefreshListener)
  - [TintableCompoundButton](https://developer.android.com/reference/android/support/v4/widget/TintableCompoundButton)
-

  ## Classes

  - [AutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/AutoScrollHelper)
  - [CircularProgressDrawable](https://developer.android.com/reference/android/support/v4/widget/CircularProgressDrawable)
  - [CompoundButtonCompat](https://developer.android.com/reference/android/support/v4/widget/CompoundButtonCompat)
  - [ContentLoadingProgressBar](https://developer.android.com/reference/android/support/v4/widget/ContentLoadingProgressBar)
  - [CursorAdapter](https://developer.android.com/reference/android/support/v4/widget/CursorAdapter)
  - [DrawerLayout](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout)
  - [DrawerLayout.LayoutParams](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.LayoutParams)
  - [DrawerLayout.SavedState](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.SavedState)
  - [DrawerLayout.SimpleDrawerListener](https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.SimpleDrawerListener)
  - [EdgeEffectCompat](https://developer.android.com/reference/android/support/v4/widget/EdgeEffectCompat)
  - [ExploreByTouchHelper](https://developer.android.com/reference/android/support/v4/widget/ExploreByTouchHelper)
  - [ImageViewCompat](https://developer.android.com/reference/android/support/v4/widget/ImageViewCompat)
  - [ListPopupWindowCompat](https://developer.android.com/reference/android/support/v4/widget/ListPopupWindowCompat)
  - [ListViewAutoScrollHelper](https://developer.android.com/reference/android/support/v4/widget/ListViewAutoScrollHelper)
  - [ListViewCompat](https://developer.android.com/reference/android/support/v4/widget/ListViewCompat)
  - [NestedScrollView](https://developer.android.com/reference/android/support/v4/widget/NestedScrollView)
  - [PopupMenuCompat](https://developer.android.com/reference/android/support/v4/widget/PopupMenuCompat)
  - [PopupWindowCompat](https://developer.android.com/reference/android/support/v4/widget/PopupWindowCompat)
  - [ResourceCursorAdapter](https://developer.android.com/reference/android/support/v4/widget/ResourceCursorAdapter)
  - [ScrollerCompat](https://developer.android.com/reference/android/support/v4/widget/ScrollerCompat)
  - [SimpleCursorAdapter](https://developer.android.com/reference/android/support/v4/widget/SimpleCursorAdapter)
  - [SlidingPaneLayout](https://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout)
  - [SlidingPaneLayout.LayoutParams](https://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.LayoutParams)
  - [SlidingPaneLayout.SimplePanelSlideListener](https://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.SimplePanelSlideListener)
  - [Space](https://developer.android.com/reference/android/support/v4/widget/Space)
  - [SwipeRefreshLayout](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout)
  - [TextViewCompat](https://developer.android.com/reference/android/support/v4/widget/TextViewCompat)
  - [ViewDragHelper](https://developer.android.com/reference/android/support/v4/widget/ViewDragHelper)
  - [ViewDragHelper.Callback](https://developer.android.com/reference/android/support/v4/widget/ViewDragHelper.Callback)