public final class

ItemSingleTapDetector

extends Object
implements RecyclerView.OnItemTouchListener
java.lang.Object
   ↳ com.shinobicontrols.grids.supplement.ItemSingleTapDetector

Class Overview

An implementation of android.support.v7.widget.RecyclerView.OnItemTouchListener that responds to single tap gestures made on items within the grid. It is given a ItemSingleTapDetector.Callback which determines what action should be taken when a single tap occurs.

This listener will not swallow the touch event. That is, if the View for the item that has been single tapped has its own android.view.View.OnClickListener this will also be called.

Summary

Nested Classes
interface ItemSingleTapDetector.Callback

Callback to be invoked when an item in the grid has been single tapped. 

Public Constructors
ItemSingleTapDetector(Context context)

Creates a new OnItemClickListener.

Public Methods
void setCallback(ItemSingleTapDetector.Callback callback)

Sets the ItemSingleTapDetector.Callback to be invoked when an item in the grid is single tapped.

final void setChildViewFinder(ChildViewFinder childViewFinder)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.support.v7.widget.RecyclerView.OnItemTouchListener

Public Constructors

public ItemSingleTapDetector (Context context)

Creates a new OnItemClickListener. A android.content.Context is required for construction.

Parameters
context the application's Context

Public Methods

public void setCallback (ItemSingleTapDetector.Callback callback)

Sets the ItemSingleTapDetector.Callback to be invoked when an item in the grid is single tapped. If this is null then no action will be taken on a single tap gesture occurring.

Parameters
callback the Callback to be invoked when a single tap gesture is performed on an item in the grid, may be null

public final void setChildViewFinder (ChildViewFinder childViewFinder)

Sets the ChildViewFinder for this ItemSingleTapDetector. This defines the way child views are searched for. For example, you may want to find the nearest View to a given X and Y co-ordinate thus including any space for gridlines into this calculation.

Parameters
childViewFinder the ChildViewFinder this ItemDragDetector should use