Package com.cheetahdigital.codes.ui
Class CodeScannerPresenter<T extends CodeScannerView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<T>
-
- com.cheetahdigital.codes.ui.CodeScannerPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class CodeScannerPresenter<T extends CodeScannerView> extends MvpNullObjectBasePresenter<T>
This presenter class contains all the Stellar SDK calls for the Codes Module. This is a child class ofMvpNullObjectBasePresenterwhich is bound to thsCodeScannerView, which means that this will be used to display the response from code scanning to a view type ofCodeScannerView
-
-
Constructor Summary
Constructors Constructor Description CodeScannerPresenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenterCode(CodesParams codesParams)Submits the code using thevoidenterSystemLotteryCode(CodesParams codesParams)Submits the code using the system lottery endpointprotected Listener<BaseModel<CodeData>>getCodeResponseListener()protected CodesAPIgetCodesAPI()Get current instance ofCodesAPIprotected SummaryAPIgetSummaryAPI()Get current instance ofSummaryAPIprotected voidonCodeScanFailed(java.lang.String error)Called after a failed code scanprotected voidonCodeScanSuccess(BaseModel<CodeData> model)Called after a successful code scanvoidrefreshSummary()Refresh the summary-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Method Detail
-
getCodesAPI
protected CodesAPI getCodesAPI()
Get current instance ofCodesAPI- Returns:
CodesAPIused on this presenter
-
getSummaryAPI
protected SummaryAPI getSummaryAPI()
Get current instance ofSummaryAPI- Returns:
SummaryAPIused on this presenter
-
enterSystemLotteryCode
public void enterSystemLotteryCode(@NonNull CodesParams codesParams)Submits the code using the system lottery endpoint- Parameters:
codesParams- theCodesParamsto use
-
enterCode
public void enterCode(@NonNull CodesParams codesParams)Submits the code using the- Parameters:
codesParams- theCodesParamsto use
-
getCodeResponseListener
protected Listener<BaseModel<CodeData>> getCodeResponseListener()
- Returns:
- listener for code response
-
onCodeScanFailed
protected void onCodeScanFailed(java.lang.String error)
Called after a failed code scan- Parameters:
error- details of the error message
-
onCodeScanSuccess
protected void onCodeScanSuccess(BaseModel<CodeData> model)
Called after a successful code scan- Parameters:
model- response inCodeDataformat
-
refreshSummary
public void refreshSummary()
Refresh the summary
-
-