In my project, I'm using MVP design pattern, RxJava,RxAndroid and Retrofit for consuming the API calls. Currently I am looking for solutions for trying to display an upload progress while I'm sending a picture. I have seen a couple of possible implementations, but I am afraid they do not fit within my implementation. Here's how I consume the API call with the libraries I mentioned:
Subscription subscription = mApiService.modVideoFromVideoController(userHash, videoId, publicVideo, rate)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ModifyVideoResponse>() {
@Override
public void onCompleted() {
Log.d(TAG, "modVideo onCompleted");
}
@Override
public void onError(Throwable e) {
Log.d(TAG, e.getMessage());
Crashlytics.logException(e);
}
@Override
public void onNext(ModifyVideoResponse modifyVideoResponse) {
mVideosPresenter.onVideoEdited(position, publicVideo);
}
});
mCompositeSubscription.add(subscription);
Is there a way to achieve this?