Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

RxJava for ImagePicker

Abdullah Alhazmy edited this page Sep 11, 2016 · 1 revision

It's an extenstion that allow you to return an observable from ImagePickerBuilder, all you need is to add below dependency and then return the observable from ImagePickerHelper class.

Gradle

dependencies {
	compile 'net.alhazmy13.MediaPicker:rxjava:(Last_version)'
}
  new ImagePickerHelper(
        new ImagePicker.Builder(Context)
                ...)
                .getObservable()
                .subscribe(new Subscriber<List<String>>() {
                    @Override
                    public void onCompleted() {
                        Log.d(TAG, "onCompleted() called with: " + "");
                    }

                    @Override
                    public void onError(Throwable e) {
                        Log.d(TAG, "onError()");
                    }

                    @Override
                    public void onNext(List<String> imagePaths) {
                        Log.d(TAG, "onNext() ");
                    }
                });