Class AwardsListPresenter<T extends AwardsListView>
- 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.rewards.ui.awards.AwardsListPresenter<T>
-
- Type Parameters:
T
- instance ofAwardsListView
- All Implemented Interfaces:
MvpPresenter<T>
public class AwardsListPresenter<T extends AwardsListView> extends EndlessListPresenter<T>
This class handles all the needed data processing for the Awards List. It communicates to the Cheetah Loyalty API using theRewardsAPI
. This communicates back the the API return to the view,AwardsListView
using a default listener Set Parameters: Additional parameters for the API call must also be set in order to get the correct data set for the app needs. Set the additional parameters by creating your ownRewardParams
and pass it via constructor
-
-
Constructor Summary
Constructors Constructor Description AwardsListPresenter()
Simple constructor to use to create a new Presenter for the Awards listAwardsListPresenter(RewardParams parameters)
Constructor that accepts a RewardParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ListenerModel<BaseModel<Awards>,Awards>
getAwardsReceivedListener()
Create a listener forRewardsAPI
protected RewardsAPI
getRewardsAPI()
Get current instance ofRewardsAPI
void
loadData()
Load initial view data.void
loadMore(int currentPage)
void
onLoadMoreSuccess(BaseData data)
End of load more with success requestvoid
onRefreshSuccess(BaseData data)
End of refresh with success request.void
refreshData()
Start the refresh view data.-
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
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
AwardsListPresenter
public AwardsListPresenter()
Simple constructor to use to create a new Presenter for the Awards list
-
AwardsListPresenter
public AwardsListPresenter(RewardParams parameters)
Constructor that accepts a RewardParams- Parameters:
parameters
-RewardParams
-
-
Method Detail
-
getAwardsReceivedListener
protected ListenerModel<BaseModel<Awards>,Awards> getAwardsReceivedListener()
Create a listener forRewardsAPI
- Returns:
- listener to handle
RewardsAPI
requests
-
getRewardsAPI
protected RewardsAPI getRewardsAPI()
Get current instance ofRewardsAPI
- Returns:
RewardsAPI
used on this presenter
-
loadData
public void loadData()
Description copied from class:LcePresenter
Load initial view data.- Specified by:
loadData
in classLcePresenter<T extends AwardsListView>
-
loadMore
public void loadMore(int currentPage)
- Overrides:
loadMore
in classEndlessListPresenter<T extends AwardsListView>
-
refreshData
public void refreshData()
Description copied from class:RefreshablePresenter
Start the refresh view data.- Overrides:
refreshData
in classRefreshablePresenter<T extends AwardsListView>
-
onRefreshSuccess
public void onRefreshSuccess(BaseData data)
Description copied from class:RefreshablePresenter
End of refresh with success request.- Overrides:
onRefreshSuccess
in classRefreshablePresenter<T extends AwardsListView>
- Parameters:
data
- theBaseData
.
-
onLoadMoreSuccess
public void onLoadMoreSuccess(BaseData data)
Description copied from class:EndlessListPresenter
End of load more with success request- Overrides:
onLoadMoreSuccess
in classEndlessListPresenter<T extends AwardsListView>
- Parameters:
data
- instance ofBaseData
passed
-
-