BandPredicate.NonDraggableArea

public final class BandPredicate.NonDraggableArea extends BandPredicate


A BandPredicate that allows initiation of band selection in any area that is not draggable as determined by consulting inDragRegion. By default empty areas (those with a position that maps to NO_POSITION are considered non-draggable.

Use this implementation in order to permit band selection in otherwise empty areas of a View. This is useful especially in list layouts where there is no empty space surrounding the list items, and individual list items may contain extra white space (like in a list of varying length words).

See also
inDragRegion

Summary

Public constructors

NonDraggableArea(
    @NonNull RecyclerView recyclerView,
    @NonNull ItemDetailsLookup<Object> detailsLookup
)

Creates a new instance.

Public methods

boolean

Public constructors

NonDraggableArea

Added in 1.1.0
public NonDraggableArea(
    @NonNull RecyclerView recyclerView,
    @NonNull ItemDetailsLookup<Object> detailsLookup
)

Creates a new instance.

Parameters
@NonNull RecyclerView recyclerView

the owner RecyclerView

@NonNull ItemDetailsLookup<Object> detailsLookup

provides access to item details.

Public methods

canInitiate

Added in 1.2.0-alpha02
public boolean canInitiate(@NonNull MotionEvent e)
Returns
boolean

true if band selection can be initiated in response to the MotionEvent.