# BandPredicate

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) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***


```
public abstract class BandPredicate
```

<br />

Known direct subclasses [BandPredicate.EmptyArea](https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.EmptyArea), [BandPredicate.NonDraggableArea](https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea)

|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.EmptyArea` | A BandPredicate that allows initiation of band selection only in areas of RecyclerView that map to `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView#NO_POSITION()`. |
| `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)`. |

*** ** * ** ***

Provides a means of controlling when and where band selection can be initiated.

Two default implementations are provided: `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.EmptyArea`, and `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/selection/SelectionTracker.Builder#withBandPredicate(androidx.recyclerview.selection.BandPredicate)` |   |

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.EmptyArea extends https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate` A BandPredicate that allows initiation of band selection only in areas of RecyclerView that map to `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView#NO_POSITION()`. |
| `public final class https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.NonDraggableArea extends https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate` 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)`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate#BandPredicate()()` |

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

## Public constructors

### BandPredicate

Added in 1.0.0

```
public BandPredicate()
```

## Public methods

### canInitiate

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

```
public abstract 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`. |