rxdialog/src/main/java/com/kevadiyakrunalk/rxdialog/RxPromptDialog.java
/**
         * To observable observable.
         *
         * @return the observable
         */
To observable observable.
@return the observable
To observable observable . @return the observable
public Observable<Integer> toObservable() {
            return Observable.create((Subscriber<? super Integer> subscriber) -> {
                try {
                    new Handler(Looper.getMainLooper()).post(() -> {
                        final RxPromptDialog dialog = create();
                        subscriber.add(Subscriptions.create(dialog::dismiss));
                        dialog.show();
                        controller.setButtonListener((dialog1, which) -> {
                            subscriber.onNext(which);
                            if (which != ButtonListener.DIALOG_SHOW)
                                subscriber.onCompleted();
                        });
                        dialog.refreshView();
                    });
                } catch (Exception e) {
                    subscriber.onCompleted();
                }
            });
        }
public Observable < Integer > toObservable ( ) { return Observable . create ( ( Subscriber < ? super Integer > subscriber ) -> { try { new Handler ( Looper . getMainLooper ( ) ) . post ( ( ) -> { final RxPromptDialog dialog = create ( ) ; subscriber . add ( Subscriptions . create ( dialog :: dismiss ) ) ; dialog . show ( ) ; controller . setButtonListener ( ( dialog1 , which ) -> { subscriber . onNext ( which ) ; if ( which != ButtonListener . DIALOG_SHOW ) subscriber . onCompleted ( ) ; } ) ; dialog . refreshView ( ) ; } ) ; } catch ( Exception e ) { subscriber . onCompleted ( ) ; } } ) ; }
To observable observable.
To observable observable .
// cleaning up