Register now for Android Dev Summit 2019!

NonDraggableArea

class NonDraggableArea : BandPredicate
kotlin.Any
   ↳ androidx.recyclerview.selection.BandPredicate
   ↳ androidx.recyclerview.selection.BandPredicate.NonDraggableArea

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

Public constructors

<init>(@NonNull recyclerView: RecyclerView, @NonNull detailsLookup: ItemDetailsLookup<Any!>)

Creates a new instance.

Public methods

Boolean
canInitiate(@NonNull e: MotionEvent)

Public constructors

<init>

NonDraggableArea(@NonNull recyclerView: RecyclerView, @NonNull detailsLookup: ItemDetailsLookup<Any!>)

Creates a new instance.

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

Public methods

canInitiate

fun canInitiate(@NonNull e: MotionEvent): Boolean