Class OffersWithResponsesListPresenter<T extends OffersWithResponsesListView>

  • Type Parameters:
    T - the MvpView class
    All Implemented Interfaces:
    com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>

    public class OffersWithResponsesListPresenter<T extends OffersWithResponsesListView>
    extends com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T>
    The MvpPresenter class for OffersWithResponsesListFragment
    • Constructor Detail

      • OffersWithResponsesListPresenter

        public OffersWithResponsesListPresenter()
        Create the presenter using an empty OfferParams
      • OffersWithResponsesListPresenter

        public OffersWithResponsesListPresenter​(OfferParams offerParams,
                                                @Nullable
                                                java.lang.String earnedOfferCategory)
        Create the presenter with a give OfferParams
        Parameters:
        offerParams - the OfferParams
        earnedOfferCategory - category to identify if an object is an offer response. If this is null, then all data in list will be considered an offer.
    • Method Detail

      • getClipListener

        protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getClipListener​(int id)
        Create a listener for clipping and unclipping offer and offer response
        Parameters:
        id - id of the offer
        Returns:
        listener to handle requests
      • getEarnedOfferCategory

        public java.lang.String getEarnedOfferCategory()
        Returns the earned offer category.
        Returns:
        category
      • loadData

        public void loadData()
        Description copied from class: com.cheetahdigital.uikit.architecture.lce.LcePresenter
        Load initial view data.
        Specified by:
        loadData in class com.cheetahdigital.uikit.architecture.lce.LcePresenter<T extends OffersWithResponsesListView>
      • refreshData

        public void refreshData()
        Description copied from class: com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
        Start the refresh view data.
        Overrides:
        refreshData in class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends OffersWithResponsesListView>
      • loadMore

        public void loadMore​(int currentPage)
        Overrides:
        loadMore in class com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T extends OffersWithResponsesListView>
      • onRefreshSuccess

        public void onRefreshSuccess​(com.cheetahdigital.corekit.models.data.BaseData data)
        Description copied from class: com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
        End of refresh with success request.
        Overrides:
        onRefreshSuccess in class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends OffersWithResponsesListView>
        Parameters:
        data - the BaseData.
      • onLoadMoreSuccess

        public void onLoadMoreSuccess​(com.cheetahdigital.corekit.models.data.BaseData data)
        Description copied from class: com.cheetahdigital.uikit.widget.list.EndlessListPresenter
        End of load more with success request
        Overrides:
        onLoadMoreSuccess in class com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T extends OffersWithResponsesListView>
        Parameters:
        data - instance of BaseData passed
      • sendOfferResponse

        public void sendOfferResponse​(int id)
        Respond to an Offer
        Parameters:
        id - offer id to be responded
      • sendOfferResponse

        public void sendOfferResponse​(int id,
                                      OfferParams offerParams)
        Respond to an Offer
        Parameters:
        id - offer id to be responded
        offerParams - custom OfferParams
      • clipOffer

        public void clipOffer​(int id)
        Clip an offer
        Parameters:
        id - id of offer
      • clipOffer

        public void clipOffer​(int id,
                              OfferParams offerParams)
        Clip an offer
        Parameters:
        id - id of offer
        offerParams - custom OfferParams
      • unclipOffer

        public void unclipOffer​(int id)
        Unclip an offer
        Parameters:
        id - id of offer
      • unclipOffer

        public void unclipOffer​(int id,
                                OfferParams offerParams)
        Unclip an offer
        Parameters:
        id - id of offer
        offerParams - custom OfferParams
      • clipOfferResponse

        public void clipOfferResponse​(int id)
        Clip offer response
        Parameters:
        id - id of offer response
      • clipOfferResponse

        public void clipOfferResponse​(int id,
                                      OfferParams offerParams)
        Clip offer response
        Parameters:
        id - id of offer response
        offerParams - custom OfferParams
      • unclipOfferResponse

        public void unclipOfferResponse​(int id)
        Unclip offer response
        Parameters:
        id - id of offer response
      • unclipOfferResponse

        public void unclipOfferResponse​(int id,
                                        OfferParams offerParams)
        Unclip offer response
        Parameters:
        id - id of offer response
        offerParams - custom OfferParams
      • onClipOfferFailed

        protected void onClipOfferFailed​(java.lang.String error,
                                         int id)
        Called when clipping of an offer or offer response fails
        Parameters:
        error - error message
        id - id of the offer or offer response
      • onClipOfferSuccess

        protected void onClipOfferSuccess​(int id)
        Called when clipping of an offer or offer response is successful
        Parameters:
        id - id of the offer or offer response