Package com.cheetahdigital.offers.ui
Class OfferClickListener
- java.lang.Object
-
- com.cheetahdigital.offers.ui.OfferClickListener
-
- Direct Known Subclasses:
OfferResponseClickListener,OfferWithResponseClickListener
public abstract class OfferClickListener extends java.lang.ObjectOffer click listener forOfferitems.Implement
onOfferClick(Offer, View, int), which will be called after clicking anOfferinOffersListFragmentCalling
handleOfferClick(Context, Offer, boolean)} will handle the screen redirection depending on the internal url of theOffer.
-
-
Constructor Summary
Constructors Constructor Description OfferClickListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected android.content.IntentcreateChallengeDetailIntent(android.content.Context context, int challengeId)Method called for creating theIntentfor ChallengeDetailsActivityprotected android.content.IntentcreateEventDetailIntent(android.content.Context context, int eventId)Method called for creating theIntentfor EventDetailListActivityprotected android.content.IntentcreateOfferDetailIntent(android.content.Context context, int offerId)Method called for creating theIntentforOfferDetailsActivityprotected android.content.IntentcreateRewardDetailIntent(android.content.Context context, int rewardId)Method called for creating theIntentfor RewardDetailsActivityprotected booleanhandleOfferClick(android.content.Context context, Offer offer, boolean openUrlDetail)Handle the screen redirection from the givenOffer.protected booleanlaunchIntent(android.content.Context context, android.content.Intent intent)Handles launching of intentabstract voidonOfferClick(Offer offer, android.view.View view, int position)Abstract method called after clicking anOffervoidsetIsGridView(boolean isGridView)Dictates whether the adapter uses grid view.
-
-
-
Method Detail
-
onOfferClick
public abstract void onOfferClick(Offer offer, android.view.View view, int position)
Abstract method called after clicking anOffer- Parameters:
offer- the offer clickedview- the view that was clickedposition- the layout position in the list
-
handleOfferClick
protected boolean handleOfferClick(@NonNull android.content.Context context, Offer offer, boolean openUrlDetail)Handle the screen redirection from the givenOffer. Usually called inside the implementation ofonOfferClick(Offer, View, int).
-
launchIntent
protected boolean launchIntent(@NonNull android.content.Context context, android.content.Intent intent)Handles launching of intent- Parameters:
context- used to get resourcesintent- The description of the activity to start.- Returns:
- true if intent is successfully launched, else false
-
createOfferDetailIntent
protected android.content.Intent createOfferDetailIntent(@NonNull android.content.Context context, int offerId)Method called for creating theIntentforOfferDetailsActivity- Parameters:
context- used to get resourcesofferId- theOfferid- Returns:
- the
Intentcreated
-
createEventDetailIntent
protected android.content.Intent createEventDetailIntent(@NonNull android.content.Context context, int eventId)Method called for creating theIntentfor EventDetailListActivity- Parameters:
context- used to get resourceseventId- the event id- Returns:
- the
Intentcreated
-
createChallengeDetailIntent
protected android.content.Intent createChallengeDetailIntent(@NonNull android.content.Context context, int challengeId)Method called for creating theIntentfor ChallengeDetailsActivity- Parameters:
context- used to get resourceschallengeId- the challenge id- Returns:
- the
Intentcreated
-
createRewardDetailIntent
protected android.content.Intent createRewardDetailIntent(@NonNull android.content.Context context, int rewardId)Method called for creating theIntentfor RewardDetailsActivity- Parameters:
context- used to get resourcesrewardId- the reward id- Returns:
- the
Intentcreated
-
setIsGridView
public void setIsGridView(boolean isGridView)
Dictates whether the adapter uses grid view.- Parameters:
isGridView- True if adapter is using grid view, otherwise false.
-
-