Class OffersWithResponsesListPresenter<T extends OffersWithResponsesListView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<V>
-
- com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<V>
-
- com.cheetahdigital.uikit.widget.list.ListPresenter<V>
-
- com.cheetahdigital.uikit.widget.list.EndlessListPresenter<T>
-
- com.cheetahdigital.offers.ui.list.offerswithresponses.OffersWithResponsesListPresenter<T>
-
- Type Parameters:
T
- theMvpView
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>
TheMvpPresenter
class forOffersWithResponsesListFragment
-
-
Constructor Summary
Constructors Constructor Description OffersWithResponsesListPresenter()
Create the presenter using an emptyOfferParams
OffersWithResponsesListPresenter(OfferParams offerParams, java.lang.String earnedOfferCategory)
Create the presenter with a giveOfferParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clipOffer(int id)
Clip an offervoid
clipOffer(int id, OfferParams offerParams)
Clip an offervoid
clipOfferResponse(int id)
Clip offer responsevoid
clipOfferResponse(int id, OfferParams offerParams)
Clip offer responseprotected 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 responsejava.lang.String
getEarnedOfferCategory()
Returns the earned offer category.protected OffersAPI
getOffersAPI()
Get current instance ofOffersAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Offers>,Offers>
getOffersReceivedListener()
Create a listener forOffersAPI.getOffersWithResponses(OfferParams, boolean, ListenerModel)
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<OfferResponse>,OfferResponse>
getRespondToOfferListener()
Create a listener forOffersAPI.respondToOffer(OfferParams, ListenerModel)
void
loadData()
Load initial view data.void
loadMore(int currentPage)
protected void
onClipOfferFailed(java.lang.String error, int id)
Called when clipping of an offer or offer response failsprotected void
onClipOfferSuccess(int id)
Called when clipping of an offer or offer response is successfulvoid
onLoadMoreSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
End of load more with success requestvoid
onRefreshSuccess(com.cheetahdigital.corekit.models.data.BaseData data)
End of refresh with success request.void
refreshData()
Start the refresh view data.void
sendOfferResponse(int id)
Respond to an Offervoid
sendOfferResponse(int id, OfferParams offerParams)
Respond to an Offervoid
unclipOffer(int id)
Unclip an offervoid
unclipOffer(int id, OfferParams offerParams)
Unclip an offervoid
unclipOfferResponse(int id)
Unclip offer responsevoid
unclipOfferResponse(int id, OfferParams offerParams)
Unclip offer response-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListPresenter
isAppending, onLoadMoreFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
isRefreshing, onRefreshFailed
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
-
-
-
Constructor Detail
-
OffersWithResponsesListPresenter
public OffersWithResponsesListPresenter()
Create the presenter using an emptyOfferParams
-
OffersWithResponsesListPresenter
public OffersWithResponsesListPresenter(OfferParams offerParams, @Nullable java.lang.String earnedOfferCategory)
Create the presenter with a giveOfferParams
- Parameters:
offerParams
- theOfferParams
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
-
getOffersReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Offers>,Offers> getOffersReceivedListener()
Create a listener forOffersAPI.getOffersWithResponses(OfferParams, boolean, ListenerModel)
- Returns:
- listener to handle requests
-
getRespondToOfferListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<OfferResponse>,OfferResponse> getRespondToOfferListener()
Create a listener forOffersAPI.respondToOffer(OfferParams, ListenerModel)
- Returns:
- listener to handle requests
-
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
-
getOffersAPI
protected OffersAPI getOffersAPI()
Get current instance ofOffersAPI
- Returns:
OffersAPI
used on this presenter
-
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 classcom.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 classcom.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends OffersWithResponsesListView>
-
loadMore
public void loadMore(int currentPage)
- Overrides:
loadMore
in classcom.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 classcom.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter<T extends OffersWithResponsesListView>
- Parameters:
data
- theBaseData
.
-
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 classcom.cheetahdigital.uikit.widget.list.EndlessListPresenter<T extends OffersWithResponsesListView>
- Parameters:
data
- instance ofBaseData
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 respondedofferParams
- customOfferParams
-
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 offerofferParams
- customOfferParams
-
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 offerofferParams
- customOfferParams
-
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 responseofferParams
- customOfferParams
-
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 responseofferParams
- customOfferParams
-
onClipOfferFailed
protected void onClipOfferFailed(java.lang.String error, int id)
Called when clipping of an offer or offer response fails- Parameters:
error
- error messageid
- 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
-
-