Created
January 16, 2017 15:58
-
-
Save jcaiqueoliveira/801b4e2112658eb450c3c744400bf51c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HistoryPresenter @Inject constructor(var paymentManager: PaymentRepository) : HistoryContract.Presenter { | |
lateinit var context: Context | |
lateinit var view: HistoryContract.View | |
override fun bindView(context: Context, view: HistoryContract.View) { | |
this.context = context | |
this.view = view | |
} | |
override fun loadHistory() { | |
view.showWaitingDialog() | |
paymentManager.getHistory(HistoryRequest()) | |
.subscribe({ response -> | |
if (response.code() == 200) { | |
view.showHistoryPayment(response.body()) | |
} else { | |
view.showMessageError(context.getString(R.string.error_msg_generic)) | |
} | |
}, Throwable::printStackTrace) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment