# BandPredicate.EmptyArea

# BandPredicate.EmptyArea

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/recyclerview/selection/BandPredicate.EmptyArea "View this page in Java")

<br />

```
class BandPredicate.EmptyArea : 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.EmptyArea](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/BandPredicate.EmptyArea) |

*** ** * ** ***

A BandPredicate that allows initiation of band selection only in areas of RecyclerView that map to[NO_POSITION](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView#NO_POSITION()). In most cases, this will be the empty areas between views.

Use this implementation to permit band selection only in empty areas surrounding view items. But be advised that if there is no empy area around view items, band selection cannot be initiated.

## Summary

|                                                                                                                                       ### Public constructors                                                                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [EmptyArea](https://developer.android.com/reference/kotlin/androidx/recyclerview/selection/BandPredicate.EmptyArea#EmptyArea(androidx.recyclerview.widget.RecyclerView))`(recyclerView: `[RecyclerView](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView)`)` |

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

## Public constructors

### EmptyArea

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

```
EmptyArea(recyclerView: RecyclerView)
```  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|------------------------|
| `recyclerView: `[RecyclerView](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView) | the owner RecyclerView |

## 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                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if band selection can be initiated in response to the[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html). |