Class ChallengeResponsePresenter<T extends ChallengeResponseView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<T>
-
- com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter<T>
-
- Type Parameters:
T
- instance ofChallengeResponseView
- All Implemented Interfaces:
MvpPresenter<T>
- Direct Known Subclasses:
CaptionPhotoPresenter
,CheckInPresenter
,GamePresenter
,MultiQuestionPresenter
,PhotoPresenter
,UpdateAttributePresenter
,UpdatePreferencesPresenter
,VideoPresenter
,ViewContentPresenter
public class ChallengeResponsePresenter<T extends ChallengeResponseView> extends Presenter<T>
Presenter used by different Challenge response activities
-
-
Constructor Summary
Constructors Constructor Description ChallengeResponsePresenter(java.lang.String id, java.lang.String responseId)
Create the presenter with defaultChallengeParams
ChallengeResponsePresenter(java.lang.String id, java.lang.String responseId, ChallengeParams params)
Create the presenter with a givenChallengeParams
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChallengesAPI
getChallengesAPI()
Get current instance ofChallengesAPI
ListenerModel<BaseModel<Response>,Response>
getRespondListener()
Create a listener forChallengesAPI
protected void
onRespondFailed(java.lang.String error)
Show challenge response error messageprotected void
onRespondSuccess(Response data)
Notify the view that the challenge response is successfulprotected void
submitChallengeResponse(ChallengeFields challengeFields)
Respond to a challengeprotected void
submitChallengeResponse(ChallengeFields challengeFields, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challengeprotected void
submitChallengeResponse(ChallengeParts challengeParts)
Respond to a challengeprotected void
submitChallengeResponse(ChallengeParts challengeParts, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challengeprotected void
submitChallengeResponse(okhttp3.RequestBody body)
Respond to a challengeprotected void
submitChallengeResponse(okhttp3.RequestBody body, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
ChallengeResponsePresenter
public ChallengeResponsePresenter(java.lang.String id, java.lang.String responseId)
Create the presenter with defaultChallengeParams
- Parameters:
id
- challenge idresponseId
- response id
-
ChallengeResponsePresenter
public ChallengeResponsePresenter(java.lang.String id, java.lang.String responseId, ChallengeParams params)
Create the presenter with a givenChallengeParams
- Parameters:
id
- challenge idresponseId
- response idparams
- theChallengeParams
-
-
Method Detail
-
getChallengesAPI
public ChallengesAPI getChallengesAPI()
Get current instance ofChallengesAPI
- Returns:
ChallengesAPI
used on this presenter
-
getRespondListener
public ListenerModel<BaseModel<Response>,Response> getRespondListener()
Create a listener forChallengesAPI
- Returns:
- listener to handle
ChallengesAPI
requests
-
submitChallengeResponse
protected void submitChallengeResponse(ChallengeFields challengeFields)
Respond to a challenge- Parameters:
challengeFields
- answers that is attached upon responding to the challenge
-
submitChallengeResponse
protected void submitChallengeResponse(ChallengeParts challengeParts)
Respond to a challenge- Parameters:
challengeParts
- answers that is attached upon responding to the challenge
-
submitChallengeResponse
protected void submitChallengeResponse(okhttp3.RequestBody body)
Respond to a challenge- Parameters:
body
- answers that is attached upon responding to the challenge
-
submitChallengeResponse
protected void submitChallengeResponse(ChallengeFields challengeFields, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
challengeFields
- answers that is attached upon responding to the challengelistener
- handle challenge response
-
submitChallengeResponse
protected void submitChallengeResponse(ChallengeParts challengeParts, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
challengeParts
- answers that is attached upon responding to the challengelistener
- handle challenge response
-
submitChallengeResponse
protected void submitChallengeResponse(okhttp3.RequestBody body, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
body
- answers that is attached upon responding to the challengelistener
- handle challenge response
-
onRespondSuccess
protected void onRespondSuccess(Response data)
Notify the view that the challenge response is successful- Parameters:
data
- theResponse
-
onRespondFailed
protected void onRespondFailed(java.lang.String error)
Show challenge response error message- Parameters:
error
- message
-
-