Package com.cheetahdigital.rewards.ui
Class ItemClickListener<T>
- java.lang.Object
-
- com.cheetahdigital.rewards.ui.ItemClickListener<T>
-
public abstract class ItemClickListener<T> extends java.lang.Object
Item click listener for list items.Implement
onItemClick(Object, View, int)
, which will be called after clicking anItemClickListener
in from the list fragmentCalling
handleItemClick(Context, int, int, String, String)
} will handle the screen redirection depending on the id of theItemClickListener
.
-
-
Constructor Summary
Constructors Constructor Description ItemClickListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected android.content.Intent
createDetailsIntent(java.lang.String id, java.lang.String action)
Method called to create the necessary intent based on the item id and the action setprotected boolean
handleItemClick(android.content.Context context, int id, int awardId, java.lang.String awardStatus, java.lang.String action)
Handles the screen redirection from the list Usually called inside the implementation ofonItemClick(Object, View, int)
abstract void
onItemClick(T item, android.view.View view, int position)
Abstract method to be called after clicking an item from the list
-
-
-
Method Detail
-
onItemClick
public abstract void onItemClick(T item, android.view.View view, int position)
Abstract method to be called after clicking an item from the list- Parameters:
item
- object of typeBaseData
view
- the view which received the clickposition
- position of the view
-
handleItemClick
protected boolean handleItemClick(@NonNull android.content.Context context, int id, int awardId, @Nullable java.lang.String awardStatus, java.lang.String action)
Handles the screen redirection from the list Usually called inside the implementation ofonItemClick(Object, View, int)
- Parameters:
context
- used to get resourcesid
- id of the item clickedawardId
- id of the award if from the awards list otherwise set to -1awardStatus
- status to set for current awardaction
- implicit action for the intent- Returns:
true
if the offer click was handle otherwisefalse
-
createDetailsIntent
protected android.content.Intent createDetailsIntent(java.lang.String id, java.lang.String action)
Method called to create the necessary intent based on the item id and the action set- Parameters:
id
- id of the item clickedaction
- implicit action for the intent- Returns:
- intent for details
-
-