ItemDetailsLookup


abstract class ItemDetailsLookup<K>


The Selection library calls getItemDetails when it needs access to information about the area and/or ItemDetails under a MotionEvent. Your implementation must negotiate ViewHolder lookup with the corresponding RecyclerView instance, and the subsequent conversion of the ViewHolder instance to an ItemDetails instance.

Example

final class MyDetailsLookup extends ItemDetailsLookup{

  private final RecyclerView mRecyclerView;

  MyDetailsLookup(RecyclerView recyclerView) {
      mRecyclerView = recyclerView;
  }

  public @Nullable ItemDetails
Parameters
<K>

Selection key type. @see StorageStrategy for supported types.

Summary

Nested types

An ItemDetails implementation provides the selection library with access to information about a specific RecyclerView item.

Public constructors

Public functions

abstract ItemDetailsLookup.ItemDetails<K!>?

Public constructors

ItemDetailsLookup

Added in 1.0.0
ItemDetailsLookup()

Public functions

getItemDetails

Added in 1.0.0
abstract fun getItemDetails(e: MotionEvent): ItemDetailsLookup.ItemDetails<K!>?
Returns
ItemDetailsLookup.ItemDetails<K!>?

the ItemDetails for the item under the event, or null.