public final class

BandPredicate.NonDraggableArea

extends BandPredicate

 java.lang.Object

androidx.recyclerview.selection.BandPredicate

↳androidx.recyclerview.selection.BandPredicate.NonDraggableArea

Overview

A BandPredicate that allows initiation of band selection in any area that is not draggable as determined by consulting ItemDetailsLookup.ItemDetails.inDragRegion(MotionEvent). By default empty areas (those with a position that maps to RecyclerView.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).

Summary

Constructors
publicNonDraggableArea(RecyclerView recyclerView, ItemDetailsLookup<java.lang.Object> detailsLookup)

Creates a new instance.

Methods
public abstract booleancanInitiate(MotionEvent e)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public NonDraggableArea(RecyclerView recyclerView, ItemDetailsLookup<java.lang.Object> detailsLookup)

Creates a new instance.

Parameters:

recyclerView: the owner RecyclerView
detailsLookup: provides access to item details.

Methods

public abstract boolean canInitiate(MotionEvent e)

Returns:

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