ItemDetailsLookup


public 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

public abstract class ItemDetailsLookup.ItemDetails<K>

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

Public constructors

Public constructors

ItemDetailsLookup

Added in 1.0.0
public ItemDetailsLookup()

Public methods

getItemDetails

Added in 1.0.0
public abstract @Nullable ItemDetailsLookup.ItemDetails<K> getItemDetails(@NonNull MotionEvent e)
Returns
@Nullable ItemDetailsLookup.ItemDetails<K>

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