# AutoScrollHelper

# AutoScrollHelper

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/widget/AutoScrollHelper.java+class:androidx.core.widget.AutoScrollHelper)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/widget/AutoScrollHelper "View this page in Java")

<br />

```
abstract class AutoScrollHelper : View.OnTouchListener
```

<br />

Known direct subclasses  
[ListViewAutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewAutoScrollHelper)  

|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ListViewAutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/ListViewAutoScrollHelper) | An implementation of[AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)that knows how to scroll through a[ListView](https://developer.android.com/reference/android/widget/ListView.html). |

*** ** * ** ***

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

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

# Activation

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/kotlin/androidx/core/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](https://developer.android.com/reference/kotlin/androidx/core/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](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEdgeType(int)). Default value is[EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND()).
- Size of activation areas relative to view size, see[setRelativeEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRelativeEdges(float,float)). Default value is 20% for both vertical and horizontal edges.
- Maximum size used to constrain relative size, see[setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float)). Default value is[NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX()).

# Scrolling

When automatic scrolling is active, the helper will repeatedly call[scrollTargetBy](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#scrollTargetBy(int,int))to apply new scrolling offsets.

The following scrolling properties may be configured:

- Acceleration ramp-up duration, see[setRampUpDuration](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRampUpDuration(int)). Default value is 500 milliseconds.
- Acceleration ramp-down duration, see[setRampDownDuration](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRampDownDuration(int)). Default value is 500 milliseconds.
- Target velocity relative to view size, see[setRelativeVelocity](https://developer.android.com/reference/kotlin/androidx/core/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](https://developer.android.com/reference/kotlin/androidx/core/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](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float)). Default value is approximately 25 centimeters or 1575 dips per second.

## Summary

|                                      ### Constants                                      |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | [EDGE_TYPE_INSIDE](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#EDGE_TYPE_INSIDE())` = 0` Edge type that specifies an activation area starting at the view bounds and extending inward.                                                                                                                                                                                                                                                                                                                                            |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | [EDGE_TYPE_INSIDE_EXTEND](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#EDGE_TYPE_INSIDE_EXTEND())` = 1` Edge type that specifies an activation area starting at the view bounds and extending inward.                                                                                                                                                                                                                                                                                                                              |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | [EDGE_TYPE_OUTSIDE](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#EDGE_TYPE_OUTSIDE())` = 2` Edge type that specifies an activation area starting at the view bounds and extending outward.                                                                                                                                                                                                                                                                                                                                         |
| `const `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX())` = 3.4028235E38f` Constant passed to[setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float)),[setMaximumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float)), or[setMinimumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMinimumVelocity(float,float)). |
| `const `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [NO_MIN](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MIN())` = 0.0f` Constant passed to[setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float)), or[setMaximumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float)), or[setMinimumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMinimumVelocity(float,float)).       |
| `const `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [RELATIVE_UNSPECIFIED](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED())` = 0.0f` Constant passed to[setRelativeEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRelativeEdges(float,float))or[setRelativeVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRelativeVelocity(float,float)).                                                                                                                       |

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

|                                            ### Public functions                                             |
|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)              | [canTargetScrollHorizontally](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#canTargetScrollHorizontally(int))`(direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Override this method to return whether the target view can be scrolled horizontally in a certain direction.                                                                        |
| `abstract `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)              | [canTargetScrollVertically](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#canTargetScrollVertically(int))`(direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Override this method to return whether the target view can be scrolled vertically in a certain direction.                                                                              |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [isEnabled](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#isEnabled())`()`                                                                                                                                                                                                                                                                                                                   |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [isExclusive](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#isExclusive())`()` Indicates whether the scroll helper handles touch events exclusively during scrolling.                                                                                                                                                                                                                        |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [onTouch](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#onTouch(android.view.View,android.view.MotionEvent))`(v: `[View](https://developer.android.com/reference/android/view/View.html)`!, event: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`!)` Handles touch events by activating automatic scrolling, adjusting scroll velocity, or stopping. |
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                    | [scrollTargetBy](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#scrollTargetBy(int,int))`(deltaX: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, deltaY: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Override this method to scroll the target view by the specified number of pixels.                                    |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setActivationDelay](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setActivationDelay(int))`(delayMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets the delay after entering an activation edge before activation of auto-scrolling.                                                                                                              |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setEdgeType](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEdgeType(int))`(type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets the activation edge type, one of:                                                                                                                                                                                  |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)`!` | [setEnabled](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEnabled(boolean))`(enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether the scroll helper is enabled and should respond to touch events.                                                                                                                              |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)`!` | [setExclusive](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setExclusive(boolean))`(exclusive: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Enables or disables exclusive handling of touch events during scrolling.                                                                                                                             |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float))`(horizontalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, verticalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the absolute maximum edge size.                                                       |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setMaximumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float))`(horizontalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, verticalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the absolute maximum scrolling velocity.                                        |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setMinimumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMinimumVelocity(float,float))`(horizontalMin: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, verticalMin: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the absolute minimum scrolling velocity.                                        |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setRampDownDuration](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRampDownDuration(int))`(durationMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` 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/kotlin/androidx/core/widget/AutoScrollHelper)    | [setRampUpDuration](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRampUpDuration(int))`(durationMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` 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/kotlin/androidx/core/widget/AutoScrollHelper)    | [setRelativeEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRelativeEdges(float,float))`(horizontal: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, vertical: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the activation edge size relative to the host view's dimensions.                          |
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)    | [setRelativeVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setRelativeVelocity(float,float))`(horizontal: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, vertical: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the target scrolling velocity relative to the host view's dimensions.               |

## Constants

### EDGE_TYPE_INSIDE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val EDGE_TYPE_INSIDE = 0: Int
```

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

|                                                       See also                                                       |
|----------------------------------------------------------------------------------------------------------------------|---|
| [setEdgeType](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEdgeType(int)) |   |

### EDGE_TYPE_INSIDE_EXTEND

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val EDGE_TYPE_INSIDE_EXTEND = 1: Int
```

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.  

|                                                       See also                                                       |
|----------------------------------------------------------------------------------------------------------------------|---|
| [setEdgeType](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEdgeType(int)) |   |

### EDGE_TYPE_OUTSIDE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val EDGE_TYPE_OUTSIDE = 2: Int
```

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

|                                                       See also                                                       |
|----------------------------------------------------------------------------------------------------------------------|---|
| [setEdgeType](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEdgeType(int)) |   |

### NO_MAX

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val NO_MAX = 3.4028235E38f: Float
```

Constant passed to[setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float)),[setMaximumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float)), or[setMinimumVelocity](https://developer.android.com/reference/kotlin/androidx/core/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.  

### NO_MIN

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val NO_MIN = 0.0f: Float
```

Constant passed to[setMaximumEdges](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumEdges(float,float)), or[setMaximumVelocity](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setMaximumVelocity(float,float)), or[setMinimumVelocity](https://developer.android.com/reference/kotlin/androidx/core/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.  

### RELATIVE_UNSPECIFIED

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
const val RELATIVE_UNSPECIFIED = 0.0f: Float
```

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

## Public constructors

### AutoScrollHelper

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
AutoScrollHelper(target: View)
```

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](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setEnabled(boolean)).  

|                                    Parameters                                    |
|----------------------------------------------------------------------------------|-----------------------------------|
| `target: `[View](https://developer.android.com/reference/android/view/View.html) | The view to automatically scroll. |

## Public functions

### canTargetScrollHorizontally

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
abstract fun canTargetScrollHorizontally(direction: Int): Boolean
```

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

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| `direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Negative to check scrolling left, positive to check scrolling right. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the target view is able to horizontally scroll in the specified direction. |

### canTargetScrollVertically

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
abstract fun canTargetScrollVertically(direction: Int): Boolean
```

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

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `direction: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Negative to check scrolling up, positive to check scrolling down. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the target view is able to vertically scroll in the specified direction. |

### isEnabled

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun isEnabled(): Boolean
```  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True if this helper is enabled and responding to touch events. |

### isExclusive

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun isExclusive(): Boolean
```

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

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True if exclusive handling of touch events during scrolling is enabled, false otherwise. |

|                                                          See also                                                          |
|----------------------------------------------------------------------------------------------------------------------------|---|
| [setExclusive](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#setExclusive(boolean)) |   |

### onTouch

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun onTouch(v: View!, event: MotionEvent!): Boolean
```

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

If[isExclusive](https://developer.android.com/reference/kotlin/androidx/core/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.  

### scrollTargetBy

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
abstract fun scrollTargetBy(deltaX: Int, deltaY: Int): Unit
```

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

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|-------------------------------------------------|
| `deltaX: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The number of pixels to scroll by horizontally. |
| `deltaY: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The number of pixels to scroll by vertically.   |

### setActivationDelay

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setActivationDelay(delayMillis: Int): AutoScrollHelper
```

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.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|---------------------------------------|
| `delayMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The activation delay in milliseconds. |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setEdgeType

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setEdgeType(type: Int): AutoScrollHelper
```

Sets the activation edge type, one of:

- [EDGE_TYPE_INSIDE](https://developer.android.com/reference/kotlin/androidx/core/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/kotlin/androidx/core/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/kotlin/androidx/core/widget/AutoScrollHelper#EDGE_TYPE_OUTSIDE())for edges that only respond to touches that move outside the bounds of the host view.

|                                     Parameters                                      |
|-------------------------------------------------------------------------------------|--------------------------|
| `type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The type of edge to use. |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setEnabled

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setEnabled(enabled: Boolean): AutoScrollHelper!
```

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

|                                           Parameters                                           |
|------------------------------------------------------------------------------------------------|---------------------------------------|
| `enabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the scroll helper is enabled. |

|                                                   Returns                                                   |
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)`!` | The scroll helper, which may used to chain setter calls. |

### setExclusive

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setExclusive(exclusive: Boolean): AutoScrollHelper!
```

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](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#onTouch(android.view.View,android.view.MotionEvent))will return true if the helper is currently scrolling and false otherwise.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `exclusive: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | True to exclusively handle touch events during scrolling, false to allow the target view to receive all touch events. |

|                                                   Returns                                                   |
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper)`!` | The scroll helper, which may used to chain setter calls. |

### setMaximumEdges

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setMaximumEdges(horizontalMax: Float, verticalMax: Float): AutoScrollHelper
```

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.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The maximum horizontal edge size in pixels, or[NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX())to use the unconstrained calculated relative value. |
| `verticalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The maximum vertical edge size in pixels, or[NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX())to use the unconstrained calculated relative value.   |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setMaximumVelocity

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setMaximumVelocity(horizontalMax: Float, verticalMax: Float): AutoScrollHelper
```

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.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The maximum horizontal scrolling velocity, or[NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX())to leave the relative value unconstrained. |
| `verticalMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The maximum vertical scrolling velocity, or[NO_MAX](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MAX())to leave the relative value unconstrained.   |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setMinimumVelocity

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setMinimumVelocity(horizontalMin: Float, verticalMin: Float): AutoScrollHelper
```

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.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontalMin: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The minimum horizontal scrolling velocity, or[NO_MIN](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MIN())to leave the relative value unconstrained. |
| `verticalMin: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The minimum vertical scrolling velocity, or[NO_MIN](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#NO_MIN())to leave the relative value unconstrained.   |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setRampDownDuration

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setRampDownDuration(durationMillis: Int): AutoScrollHelper
```

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.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|-----------------------------------------|
| `durationMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The ramp-down duration in milliseconds. |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setRampUpDuration

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setRampUpDuration(durationMillis: Int): AutoScrollHelper
```

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.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|---------------------------------------|
| `durationMillis: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The ramp-up duration in milliseconds. |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setRelativeEdges

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setRelativeEdges(horizontal: Float, vertical: Float): AutoScrollHelper
```

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.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontal: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The horizontal edge size as a fraction of the host view width, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED())to always use the maximum value. |
| `vertical: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The vertical edge size as a fraction of the host view height, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED())to always use the maximum value.  |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |

### setRelativeVelocity

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setRelativeVelocity(horizontal: Float, vertical: Float): AutoScrollHelper
```

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.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `horizontal: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The target horizontal velocity as a fraction of the host view width per second, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED())to ignore. |
| `vertical: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | The target vertical velocity as a fraction of the host view height per second, or[RELATIVE_UNSPECIFIED](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper#RELATIVE_UNSPECIFIED())to ignore.  |

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AutoScrollHelper](https://developer.android.com/reference/kotlin/androidx/core/widget/AutoScrollHelper) | The scroll helper, which may used to chain setter calls. |