Google 致力于为黑人社区推动种族平等。查看具体举措

EmptyArea

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

A BandPredicate that allows initiation of band selection only in areas of RecyclerView that map to 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
<init>(@NonNull recyclerView: RecyclerView)

Public methods
Boolean
canInitiate(@NonNull e: MotionEvent)

Public constructors

<init>

EmptyArea(@NonNull recyclerView: RecyclerView)
Parameters
recyclerView RecyclerView: the owner RecyclerView

Public methods

canInitiate

fun canInitiate(@NonNull e: MotionEvent): Boolean