ListViewAutoScrollHelper

Added in 1.1.0

class ListViewAutoScrollHelper : AutoScrollHelper


An implementation of AutoScrollHelper that knows how to scroll through a ListView.

Summary

Public constructors

Public functions

Boolean

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

Boolean

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

Unit
scrollTargetBy(deltaX: Int, deltaY: Int)

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

Inherited Constants

From androidx.core.widget.AutoScrollHelper
const Int

Edge type that specifies an activation area starting at the view bounds and extending inward.

const Int

Edge type that specifies an activation area starting at the view bounds and extending inward.

const Int

Edge type that specifies an activation area starting at the view bounds and extending outward.

const Float
NO_MAX = 3.4028235E38f

Constant passed to setMaximumEdges, setMaximumVelocity, or setMinimumVelocity.

const Float
NO_MIN = 0.0f

Constant passed to setMaximumEdges, or setMaximumVelocity, or setMinimumVelocity.

const Float

Constant passed to setRelativeEdges or setRelativeVelocity.

Inherited functions

From androidx.core.widget.AutoScrollHelper
Boolean
Boolean

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

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

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

AutoScrollHelper
setActivationDelay(delayMillis: Int)

Sets the delay after entering an activation edge before activation of auto-scrolling.

AutoScrollHelper

Sets the activation edge type, one of:

AutoScrollHelper!
setEnabled(enabled: Boolean)

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

AutoScrollHelper!
setExclusive(exclusive: Boolean)

Enables or disables exclusive handling of touch events during scrolling.

AutoScrollHelper
setMaximumEdges(horizontalMax: Float, verticalMax: Float)

Sets the absolute maximum edge size.

AutoScrollHelper
setMaximumVelocity(horizontalMax: Float, verticalMax: Float)

Sets the absolute maximum scrolling velocity.

AutoScrollHelper
setMinimumVelocity(horizontalMin: Float, verticalMin: Float)

Sets the absolute minimum scrolling velocity.

AutoScrollHelper
setRampDownDuration(durationMillis: Int)

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

AutoScrollHelper
setRampUpDuration(durationMillis: Int)

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

AutoScrollHelper
setRelativeEdges(horizontal: Float, vertical: Float)

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

AutoScrollHelper
setRelativeVelocity(horizontal: Float, vertical: Float)

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

From android.view.View.OnTouchListener
abstract Boolean
onTouch(p: View!, p1: MotionEvent!)

Public constructors

ListViewAutoScrollHelper

Added in 1.1.0
ListViewAutoScrollHelper(target: ListView)

Public functions

canTargetScrollHorizontally

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

Negative to check scrolling left, positive to check scrolling right.

Returns
Boolean

true if the target view is able to horizontally scroll in the specified direction.

canTargetScrollVertically

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

Negative to check scrolling up, positive to check scrolling down.

Returns
Boolean

true if the target view is able to vertically scroll in the specified direction.

scrollTargetBy

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

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

Parameters
deltaX: Int

The number of pixels to scroll by horizontally.

deltaY: Int

The number of pixels to scroll by vertically.