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 ofMvpNullObjectBasePresenter
which 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 void
enterCode(CodesParams codesParams)
Submits the code using thevoid
enterSystemLotteryCode(CodesParams codesParams)
Submits the code using the system lottery endpointprotected Listener<BaseModel<CodeData>>
getCodeResponseListener()
protected CodesAPI
getCodesAPI()
Get current instance ofCodesAPI
protected SummaryAPI
getSummaryAPI()
Get current instance ofSummaryAPI
protected void
onCodeScanFailed(java.lang.String error)
Called after a failed code scanprotected void
onCodeScanSuccess(BaseModel<CodeData> model)
Called after a successful code scanvoid
refreshSummary()
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:
CodesAPI
used on this presenter
-
getSummaryAPI
protected SummaryAPI getSummaryAPI()
Get current instance ofSummaryAPI
- Returns:
SummaryAPI
used on this presenter
-
enterSystemLotteryCode
public void enterSystemLotteryCode(@NonNull CodesParams codesParams)
Submits the code using the system lottery endpoint- Parameters:
codesParams
- theCodesParams
to use
-
enterCode
public void enterCode(@NonNull CodesParams codesParams)
Submits the code using the- Parameters:
codesParams
- theCodesParams
to 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 inCodeData
format
-
refreshSummary
public void refreshSummary()
Refresh the summary
-
-