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:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>
public class FriendsPresenter<T extends FriendsView> extends com.cheetahdigital.uikit.widget.list.ListPresenter<T>
TheMvpPresenter
class 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 void
connectToFacebook(java.lang.String facebookToken)
Attempt to connect to facebookvoid
connectToFacebook(java.lang.String facebookToken, com.cheetahdigital.profile.core.api.ProfileParams profileParams, com.cheetahdigital.profile.core.api.ProfileFields profileFields)
Attempt to connect to facebookprotected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse>
getConnectListener()
Create a listener forFriendsAPI
protected FriendsAPI
getFriendsAPI()
Get current instance ofFriendsAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<Friend>>,java.util.List<Friend>>
getFriendsReceivedListener()
Create a listener forFriendsAPI
protected com.cheetahdigital.profile.core.api.ProfileAPI
getProfileAPI()
Get current instance ofProfileAPI
void
loadData()
Load initial view data.void
refreshData()
Start the refresh view data.protected void
showFriendFailed()
Called after a failed Friend requestprotected void
showFriendSuccess(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
-
-
-
-
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 com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<java.util.List<Friend>>,java.util.List<Friend>> getFriendsReceivedListener()
Create a listener forFriendsAPI
- Returns:
- listener to handle
FriendsAPI
requests
-
getConnectListener
protected com.cheetahdigital.corekit.models.module.Listener<com.cheetahdigital.corekit.models.responses.SuccessResponse> getConnectListener()
Create a listener forFriendsAPI
- Returns:
- listener to handle
FriendsAPI
requests
-
getFriendsAPI
protected FriendsAPI getFriendsAPI()
Get current instance ofFriendsAPI
- Returns:
FriendsAPI
used on this presenter
-
getProfileAPI
protected com.cheetahdigital.profile.core.api.ProfileAPI getProfileAPI()
Get current instance ofProfileAPI
- Returns:
ProfileAPI
used on this presenter
-
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 FriendsView>
-
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 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, com.cheetahdigital.profile.core.api.ProfileParams profileParams, com.cheetahdigital.profile.core.api.ProfileFields profileFields)
Attempt to connect to facebook- Parameters:
facebookToken
- token generated by facebookprofileParams
-ProfileParams
to use for connecting requestprofileFields
-ProfileFields
to use for connecting request
-
showFriendSuccess
protected void showFriendSuccess(java.util.List<Friend> friends)
Called after a successful Friend request- Parameters:
friends
- response received inFriend
format
-
showFriendFailed
protected void showFriendFailed()
Called after a failed Friend request
-
-