Answer the question
In order to leave comments, you need to log in
How to unsubscribe from progress?
Good afternoon. Is it possible to move progress to the container level, which is filled with fragments.
Is this normal practice?
public interface ProgressOwner {
void setProgressState(boolean refreshing);
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout>
<ProgressBar
android:id="@+id/progress_horizontal" />
<FrameLayout
android:id="@+id/fragmentContainer" />
</LinearLayout>
mCompositeDisposable.add(
new WMSClient().send(Const.COMMAND)
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe(disposable -> getViewState().showProgress())
.doFinally(getViewState()::hideProgress)
.doOnDispose(() -> getViewState().hideProgress())
.subscribe(response -> getViewState().openWorkListFragment(response),
throwable -> getViewState().showError(throwable.getMessage()))
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question