# 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 />

```
class BandPredicate.NonDraggableArea : BandPredicate
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.recyclerview.selection.BandPredicate](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/BandPredicate) ||
|   | ↳ | [androidx.recyclerview.selection.BandPredicate.NonDraggableArea](https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/recyclerview/selection/ItemDetailsLookup.ItemDetails#inDragRegion(android.view.MotionEvent)` |   |

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/BandPredicate.NonDraggableArea#canInitiate(android.view.MotionEvent)(e: https://developer.android.com/reference/android/view/MotionEvent.html)` |

## Public constructors

### NonDraggableArea

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

```
NonDraggableArea(
    recyclerView: RecyclerView,
    detailsLookup: ItemDetailsLookup<*>
)
```

Creates a new instance.

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

## Public functions

### canInitiate

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

```
fun canInitiate(e: MotionEvent): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if band selection can be initiated in response to the `https://developer.android.com/reference/android/view/MotionEvent.html`. |