in app/src/main/java/org/apache/fineract/ui/online/loanaccounts/plannedpayment/PlannedPaymentPresenter.java [64:110]
public void fetchPlannedPayment(String productIdentifier, String caseIdentifier,
Integer pageIndex, String initialDisbursalDate) {
checkViewAttached();
getMvpView().showProgressbar();
compositeDisposable.add(dataManagerIndividualLending.getPaymentScheduleForCase(
productIdentifier, caseIdentifier, pageIndex, PAYMENT_LIST_SIZE,
initialDisbursalDate)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<PlannedPaymentPage>() {
@Override
public void onNext(PlannedPaymentPage plannedPaymentPage) {
getMvpView().hideProgressbar();
getMvpView().showPlannedPayment(plannedPaymentPage.getElements());
if (!loadmore && plannedPaymentPage.getTotalElements() == 0) {
getMvpView().showEmptyPayments(
context.getString(R.string.empty_planned_payments));
} else if (loadmore && plannedPaymentPage.getElements().size() == 0) {
getMvpView().showMessage(
context.getString(R.string.no_more_planned_payment_available));
} else {
showPlannedPayment(plannedPaymentPage.getElements());
}
}
@Override
public void onError(Throwable throwable) {
getMvpView().hideProgressbar();
if (loadmore && !(throwable instanceof NoConnectivityException)) {
getMvpView().showMessage(
context.getString(R.string.error_loading_planned_payment));
} else if (loadmore && (throwable instanceof NoConnectivityException)) {
getMvpView().showMessage(
context.getString(R.string.no_internet_connection));
} else {
showExceptionError(throwable,
context.getString(R.string.error_loading_planned_payment));
}
}
@Override
public void onComplete() {
}
})
);
}