Package com.cheetahdigital.friends.ui
Class FriendsPresenter<T extends FriendsView>
- 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<T>
-
- com.cheetahdigital.friends.ui.FriendsPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class FriendsPresenter<T extends FriendsView> extends ListPresenter<T>
TheMvpPresenterclass forFriendsFragment
-
-
Constructor Summary
Constructors Constructor Description FriendsPresenter(java.lang.String leaderboardName)Create the presenter with a leaderboard nameFriendsPresenter(java.lang.String leaderboardName, FriendsParams friendsParams)Create the presenter with a givenFriendsParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectToFacebook(java.lang.String facebookToken)Attempt to connect to facebookvoidconnectToFacebook(java.lang.String facebookToken, ProfileParams profileParams, ProfileFields profileFields)Attempt to connect to facebookprotected Listener<SuccessResponse>getConnectListener()Create a listener forFriendsAPIprotected FriendsAPIgetFriendsAPI()Get current instance ofFriendsAPIprotected ListenerModel<BaseModel<java.util.List<Friend>>,java.util.List<Friend>>getFriendsReceivedListener()Create a listener forFriendsAPIprotected ProfileAPIgetProfileAPI()Get current instance ofProfileAPIvoidloadData()Load initial view data.voidrefreshData()Start the refresh view data.protected voidshowFriendFailed()Called after a failed Friend requestprotected voidshowFriendSuccess(java.util.List<Friend> friends)Called after a successful Friend request-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshablePresenter
isRefreshing, onRefreshFailed, onRefreshSuccess
-
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
-
FriendsPresenter
public FriendsPresenter(@NonNull java.lang.String leaderboardName)Create the presenter with a leaderboard name- Parameters:
leaderboardName- the leaderboard name to use
-
FriendsPresenter
public FriendsPresenter(@NonNull java.lang.String leaderboardName, FriendsParams friendsParams)Create the presenter with a givenFriendsParams- Parameters:
leaderboardName- name for the leaderboardfriendsParams- theFriendsParams
-
-
Method Detail
-
getFriendsReceivedListener
protected ListenerModel<BaseModel<java.util.List<Friend>>,java.util.List<Friend>> getFriendsReceivedListener()
Create a listener forFriendsAPI- Returns:
- listener to handle
FriendsAPIrequests
-
getConnectListener
protected Listener<SuccessResponse> getConnectListener()
Create a listener forFriendsAPI- Returns:
- listener to handle
FriendsAPIrequests
-
getFriendsAPI
protected FriendsAPI getFriendsAPI()
Get current instance ofFriendsAPI- Returns:
FriendsAPIused on this presenter
-
getProfileAPI
protected ProfileAPI getProfileAPI()
Get current instance ofProfileAPI- Returns:
ProfileAPIused on this presenter
-
refreshData
public void refreshData()
Description copied from class:RefreshablePresenterStart the refresh view data.- Overrides:
refreshDatain classRefreshablePresenter<T extends FriendsView>
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<T extends FriendsView>
-
connectToFacebook
public void connectToFacebook(java.lang.String facebookToken)
Attempt to connect to facebook- Parameters:
facebookToken- token generated by facebook
-
connectToFacebook
public void connectToFacebook(java.lang.String facebookToken, ProfileParams profileParams, ProfileFields profileFields)Attempt to connect to facebook- Parameters:
facebookToken- token generated by facebookprofileParams-ProfileParamsto use for connecting requestprofileFields-ProfileFieldsto use for connecting request
-
showFriendSuccess
protected void showFriendSuccess(java.util.List<Friend> friends)
Called after a successful Friend request- Parameters:
friends- response received inFriendformat
-
showFriendFailed
protected void showFriendFailed()
Called after a failed Friend request
-
-