# BandPredicate.NonDraggableArea

Artifact: [androidx.recyclerview:recyclerview-selection](https://developer.android.com/jetpack/androidx/releases/recyclerview) [View Source](https://cs.android.com/search?q=file:androidx/recyclerview/selection/BandPredicate.java+class:androidx.recyclerview.selection.BandPredicate.NonDraggableArea) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***

<br />

```
public final class BandPredicate.NonDraggableArea extends BandPredicate
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.recyclerview.selection.BandPredicate](https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate) ||
|   | ↳ | [androidx.recyclerview.selection.BandPredicate.NonDraggableArea](https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea) |

*** ** * ** ***

A BandPredicate that allows initiation of band selection in any area that is not draggable as determined by consulting `https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails#inDragRegion(android.view.MotionEvent)`. By default empty areas (those with a position that maps to `https://developer.android.com/reference/androidx/recyclerview/widget/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).

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails#inDragRegion(android.view.MotionEvent)` |   |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea#NonDraggableArea(androidx.recyclerview.widget.RecyclerView,androidx.recyclerview.selection.ItemDetailsLookup<?>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView recyclerView, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup<@https://developer.android.com/reference/androidx/annotation/NonNull ?> detailsLookup )` Creates a new instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea#canInitiate(android.view.MotionEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/MotionEvent.html e)` |

## Public constructors

### NonDraggableArea

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.1.0)

```
public NonDraggableArea(
    @NonNull RecyclerView recyclerView,
    @NonNull ItemDetailsLookup<@NonNull ?> detailsLookup
)
```

Creates a new instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView recyclerView` | the owner RecyclerView |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/selection/ItemDetailsLookup<@https://developer.android.com/reference/androidx/annotation/NonNull ?> detailsLookup` | provides access to item details. |

## Public methods

### canInitiate

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.2.0-alpha02)

```
public boolean canInitiate(@NonNull MotionEvent e)
```

| Returns |
|---|---|
| `boolean` | true if band selection can be initiated in response to the `https://developer.android.com/reference/android/view/MotionEvent.html`. |