in app/src/main/java/org/apache/fineract/ui/online/roles/roleslist/RolesPresenter.java [52:82]
public void fetchRoles() {
checkViewAttached();
getMvpView().showProgressbar();
compositeDisposable.add(dataManagerRoles.getRoles()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new DisposableObserver<List<Role>>() {
@Override
public void onNext(List<Role> roles) {
getMvpView().hideProgressbar();
if (!roles.isEmpty()) {
getMvpView().showRoles(roles);
} else {
getMvpView().showEmptyRoles();
}
}
@Override
public void onError(Throwable throwable) {
getMvpView().hideProgressbar();
showExceptionError(throwable,
context.getString(R.string.error_fetching_roles));
}
@Override
public void onComplete() {
}
})
);
}