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 |
abort()
|
open Unit |
cancel() The result of a call to this method is equivalent to |
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? |
findTopChildUnder(x: Int, y: Int) 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 |
isCapturedViewUnder(x: Int, y: Int) Determine if the currently captured view is under the given point in the parent view's coordinate system. |
open Boolean |
isEdgeTouched(edges: Int) 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. |