Class ProfileLandingPresenter<T extends ProfileLandingView>
- 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<T>
-
- com.cheetahdigital.profile.ui.profile.ProfileLandingPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class ProfileLandingPresenter<T extends ProfileLandingView> extends RefreshablePresenter<T>
All the data loading process for Profile Landing is in this Presenter class ExtendsLcePresenterwithProfileLandingViewas its View
-
-
Constructor Summary
Constructors Constructor Description ProfileLandingPresenter()Empty constructor Creates a default params for the API callsProfileLandingPresenter(ProfileParams params)Constructor that accepts aProfileParamsThe params will be used for all API calls
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectToFacebook(java.lang.String facebookToken)Method that calls the API to connect the member to a Facebook identityvoidconnectToFacebook(java.lang.String facebookToken, ProfileParams profileParams, ProfileFields profileFields)Method that calls the API to connect the member to a Facebook identityprotected Listener<SuccessResponse>getConnectCallback()Create a listener forProfileAPI.connectIdentity(String, ProfileParams, ProfileFields, Listener).protected Listener<BaseGenericModel<java.util.List<Metadata>>>getMetadataReceivedListener()Create a listener forProfileAPI.getProfileMetadata(ProfileParams, boolean, Listener)}.protected ProfileAPIgetProfileAPI()Get current instance ofProfileAPIprotected Listener<Profile>getProfileReceivedListener()Create a listener forProfileAPI.getProfile(ProfileParams, boolean, Listener).voidloadData()Load initial view data.protected voidloadProfile()API call to get the member's profileprotected voidlogoutFacebook()Logs out the user from Facebookprotected voidonConnectFailure(java.lang.String error)Called when connecting identity failsprotected voidonConnectSuccess()Called when connecting identity is successfulprotected voidonMetadataDownloadFailure(java.lang.String error)Called when getting metadata failsprotected voidonMetadataDownloadSuccess(java.util.List<Metadata> data)Called when getting metadata is successfulprotected voidonProfileDownloadFailure(java.lang.String error)Called when getting profile failsprotected voidonProfileDownloadSuccess(Profile data)Called when getting profile is successfulvoidrefreshData()Start the refresh view data.-
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
-
ProfileLandingPresenter
public ProfileLandingPresenter()
Empty constructor Creates a default params for the API calls
-
ProfileLandingPresenter
public ProfileLandingPresenter(ProfileParams params)
Constructor that accepts aProfileParamsThe params will be used for all API calls- Parameters:
params- query params for Profile API
-
-
Method Detail
-
getProfileAPI
protected ProfileAPI getProfileAPI()
Get current instance ofProfileAPI- Returns:
ProfileAPIused on this presenter
-
getMetadataReceivedListener
protected Listener<BaseGenericModel<java.util.List<Metadata>>> getMetadataReceivedListener()
Create a listener forProfileAPI.getProfileMetadata(ProfileParams, boolean, Listener)}.- Returns:
- listener to handle requests
-
getProfileReceivedListener
protected Listener<Profile> getProfileReceivedListener()
Create a listener forProfileAPI.getProfile(ProfileParams, boolean, Listener).- Returns:
- listener to handle requests
-
getConnectCallback
protected Listener<SuccessResponse> getConnectCallback()
Create a listener forProfileAPI.connectIdentity(String, ProfileParams, ProfileFields, Listener).- Returns:
- listener to handle requests
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<T extends ProfileLandingView>
-
refreshData
public void refreshData()
Description copied from class:RefreshablePresenterStart the refresh view data.- Overrides:
refreshDatain classRefreshablePresenter<T extends ProfileLandingView>
-
connectToFacebook
public void connectToFacebook(java.lang.String facebookToken)
Method that calls the API to connect the member to a Facebook identity- Parameters:
facebookToken- authentication token from Facebook
-
connectToFacebook
public void connectToFacebook(java.lang.String facebookToken, ProfileParams profileParams, ProfileFields profileFields)Method that calls the API to connect the member to a Facebook identity- Parameters:
facebookToken- authentication token from FacebookprofileParams- customProfileParamsprofileFields- customProfileFields
-
loadProfile
protected void loadProfile()
API call to get the member's profile
-
onMetadataDownloadFailure
protected void onMetadataDownloadFailure(java.lang.String error)
Called when getting metadata fails- Parameters:
error- error message
-
onMetadataDownloadSuccess
protected void onMetadataDownloadSuccess(java.util.List<Metadata> data)
Called when getting metadata is successful- Parameters:
data- list ofMetadata
-
onProfileDownloadFailure
protected void onProfileDownloadFailure(java.lang.String error)
Called when getting profile fails- Parameters:
error- error message
-
onProfileDownloadSuccess
protected void onProfileDownloadSuccess(Profile data)
Called when getting profile is successful- Parameters:
data-Profile
-
onConnectFailure
protected void onConnectFailure(java.lang.String error)
Called when connecting identity fails- Parameters:
error- error message
-
logoutFacebook
protected void logoutFacebook()
Logs out the user from Facebook
-
onConnectSuccess
protected void onConnectSuccess()
Called when connecting identity is successful
-
-