Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

ViewDragHelper

open class ViewDragHelper
kotlin.Any
   ↳ androidx.customview.widget.ViewDragHelper

ViewDragHelper is a utility class for writing custom ViewGroups. It offers a number of useful operations and state tracking for allowing a user to drag and reposition views within their parent ViewGroup.

Summary

Nested classes
abstract

A Callback is used as a communication channel with the ViewDragHelper back to the parent view using it.

Constants
static Int

Indicates that a check should occur along all axes

static Int

Indicates that a check should occur along the horizontal axis

static Int

Indicates that a check should occur along the vertical axis

static Int

Edge flag set indicating all edges should be affected.

static Int

Edge flag indicating that the bottom edge should be affected.

static Int

Edge flag indicating that the left edge should be affected.

static Int

Edge flag indicating that the right edge should be affected.

static Int

Edge flag indicating that the top edge should be affected.

static Int

A null/invalid pointer ID.

static Int

A view is currently being dragged.

static Int

A view is not currently being dragged or animating as a result of a fling/snap.

static Int

A view is currently settling into place as a result of a fling or predefined non-interactive motion.

Public methods
open Unit

cancel(), but also abort all motion in progress and snap to the end of any animation.

open Unit

The result of a call to this method is equivalent to processTouchEvent(android.view.MotionEvent) receiving an ACTION_CANCEL event.

open Unit
captureChildView(@NonNull childView: View, activePointerId: Int)

Capture a specific child view for dragging within the parent.

open Boolean
checkTouchSlop(directions: Int)

Check if any pointer tracked in the current gesture has crossed the required slop threshold.

open Boolean
checkTouchSlop(directions: Int, pointerId: Int)

Check if the specified pointer tracked in the current gesture has crossed the required slop threshold.

open Boolean
continueSettling(deferCallbacks: Boolean)

Move the captured settling view by the appropriate amount for the current time.

open static ViewDragHelper!
create(@NonNull forParent: ViewGroup, @NonNull cb: ViewDragHelper.Callback)

Factory method to create a new ViewDragHelper.

open static ViewDragHelper!
create(@NonNull forParent: ViewGroup, sensitivity: Float, @NonNull cb: ViewDragHelper.Callback)

Factory method to create a new ViewDragHelper.

open View?

Find the topmost child under the given point within the parent view's coordinate system.

open Unit
flingCapturedView(minLeft: Int, minTop: Int, maxLeft: Int, maxTop: Int)

Settle the captured view based on standard free-moving fling behavior.

open Int

open View?

open Int

Return the default size used for edge tracking.

open Int

Return the size of an edge.

open Float

Return the currently configured minimum velocity.

open Int

open Int

Retrieve the current drag state of this helper.

open Boolean

Determine if the currently captured view is under the given point in the parent view's coordinate system.

open Boolean

Check if any of the edges specified were initially touched in the currently active gesture.

open Boolean
isEdgeTouched(edges: Int, pointerId: Int)

Check if any of the edges specified were initially touched by the pointer with the specified ID.