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.Object
Offer click listener forOffer
items.Implement
onOfferClick(Offer, View, int)
, which will be called after clicking anOffer
inOffersListFragment
Calling
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.Intent
createChallengeDetailIntent(android.content.Context context, int challengeId)
Method called for creating theIntent
for ChallengeDetailsActivityprotected android.content.Intent
createEventDetailIntent(android.content.Context context, int eventId)
Method called for creating theIntent
for EventDetailListActivityprotected android.content.Intent
createOfferDetailIntent(android.content.Context context, int offerId)
Method called for creating theIntent
forOfferDetailsActivity
protected android.content.Intent
createRewardDetailIntent(android.content.Context context, int rewardId)
Method called for creating theIntent
for RewardDetailsActivityprotected boolean
handleOfferClick(android.content.Context context, Offer offer, boolean openUrlDetail)
Handle the screen redirection from the givenOffer
.protected boolean
launchIntent(android.content.Context context, android.content.Intent intent)
Handles launching of intentabstract void
onOfferClick(Offer offer, android.view.View view, int position)
Abstract method called after clicking anOffer
void
setIsGridView(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 theIntent
forOfferDetailsActivity
- Parameters:
context
- used to get resourcesofferId
- theOffer
id- Returns:
- the
Intent
created
-
createEventDetailIntent
protected android.content.Intent createEventDetailIntent(@NonNull android.content.Context context, int eventId)
Method called for creating theIntent
for EventDetailListActivity- Parameters:
context
- used to get resourceseventId
- the event id- Returns:
- the
Intent
created
-
createChallengeDetailIntent
protected android.content.Intent createChallengeDetailIntent(@NonNull android.content.Context context, int challengeId)
Method called for creating theIntent
for ChallengeDetailsActivity- Parameters:
context
- used to get resourceschallengeId
- the challenge id- Returns:
- the
Intent
created
-
createRewardDetailIntent
protected android.content.Intent createRewardDetailIntent(@NonNull android.content.Context context, int rewardId)
Method called for creating theIntent
for RewardDetailsActivity- Parameters:
context
- used to get resourcesrewardId
- the reward id- Returns:
- the
Intent
created
-
setIsGridView
public void setIsGridView(boolean isGridView)
Dictates whether the adapter uses grid view.- Parameters:
isGridView
- True if adapter is using grid view, otherwise false.
-
-