Class 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 the Intent for ChallengeDetailsActivity
      protected android.content.Intent createEventDetailIntent​(android.content.Context context, int eventId)
      Method called for creating the Intent for EventDetailListActivity
      protected android.content.Intent createOfferDetailIntent​(android.content.Context context, int offerId)
      Method called for creating the Intent for OfferDetailsActivity
      protected android.content.Intent createRewardDetailIntent​(android.content.Context context, int rewardId)
      Method called for creating the Intent for RewardDetailsActivity
      protected boolean handleOfferClick​(android.content.Context context, Offer offer, boolean openUrlDetail)
      Handle the screen redirection from the given Offer.
      protected boolean launchIntent​(android.content.Context context, android.content.Intent intent)
      Handles launching of intent
      abstract void onOfferClick​(Offer offer, android.view.View view, int position)
      Abstract method called after clicking an Offer
      void setIsGridView​(boolean isGridView)
      Dictates whether the adapter uses grid view.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OfferClickListener

        public OfferClickListener()
    • Method Detail

      • onOfferClick

        public abstract void onOfferClick​(Offer offer,
                                          android.view.View view,
                                          int position)
        Abstract method called after clicking an Offer
        Parameters:
        offer - the offer clicked
        view - the view that was clicked
        position - 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 given Offer. Usually called inside the implementation of onOfferClick(Offer, View, int).
        Parameters:
        context - used to get resources
        offer - the Offer to handle the click event
        openUrlDetail - true if Offer type url will open the detail screen, otherwise it will open an external browser
        Returns:
        true if the offer click was handled, otherwise false
      • launchIntent

        protected boolean launchIntent​(@NonNull
                                       android.content.Context context,
                                       android.content.Intent intent)
        Handles launching of intent
        Parameters:
        context - used to get resources
        intent - 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 the Intent for OfferDetailsActivity
        Parameters:
        context - used to get resources
        offerId - the Offer id
        Returns:
        the Intent created
      • createEventDetailIntent

        protected android.content.Intent createEventDetailIntent​(@NonNull
                                                                 android.content.Context context,
                                                                 int eventId)
        Method called for creating the Intent for EventDetailListActivity
        Parameters:
        context - used to get resources
        eventId - the event id
        Returns:
        the Intent created
      • createChallengeDetailIntent

        protected android.content.Intent createChallengeDetailIntent​(@NonNull
                                                                     android.content.Context context,
                                                                     int challengeId)
        Method called for creating the Intent for ChallengeDetailsActivity
        Parameters:
        context - used to get resources
        challengeId - the challenge id
        Returns:
        the Intent created
      • createRewardDetailIntent

        protected android.content.Intent createRewardDetailIntent​(@NonNull
                                                                  android.content.Context context,
                                                                  int rewardId)
        Method called for creating the Intent for RewardDetailsActivity
        Parameters:
        context - used to get resources
        rewardId - 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.