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 ExtendsLcePresenter
withProfileLandingView
as its View
-
-
Constructor Summary
Constructors Constructor Description ProfileLandingPresenter()
Empty constructor Creates a default params for the API callsProfileLandingPresenter(ProfileParams params)
Constructor that accepts aProfileParams
The params will be used for all API calls
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connectToFacebook(java.lang.String facebookToken)
Method that calls the API to connect the member to a Facebook identityvoid
connectToFacebook(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 ProfileAPI
getProfileAPI()
Get current instance ofProfileAPI
protected Listener<Profile>
getProfileReceivedListener()
Create a listener forProfileAPI.getProfile(ProfileParams, boolean, Listener)
.void
loadData()
Load initial view data.protected void
loadProfile()
API call to get the member's profileprotected void
logoutFacebook()
Logs out the user from Facebookprotected void
onConnectFailure(java.lang.String error)
Called when connecting identity failsprotected void
onConnectSuccess()
Called when connecting identity is successfulprotected void
onMetadataDownloadFailure(java.lang.String error)
Called when getting metadata failsprotected void
onMetadataDownloadSuccess(java.util.List<Metadata> data)
Called when getting metadata is successfulprotected void
onProfileDownloadFailure(java.lang.String error)
Called when getting profile failsprotected void
onProfileDownloadSuccess(Profile data)
Called when getting profile is successfulvoid
refreshData()
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 aProfileParams
The 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:
ProfileAPI
used 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:LcePresenter
Load initial view data.- Specified by:
loadData
in classLcePresenter<T extends ProfileLandingView>
-
refreshData
public void refreshData()
Description copied from class:RefreshablePresenter
Start the refresh view data.- Overrides:
refreshData
in 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
- customProfileParams
profileFields
- 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
-
-