@Test public void composer() throws Exception { Intent someIntent = new Intent(); ActivityResult testResult = new ActivityResult(Activity.RESULT_OK, Activity.RESULT_OK, someIntent); TestObserver<ActivityResult> composerTest = trigger().compose(rxActivityResults.composer(someIntent)).test(); rxActivityResults.onActivityResult(testResult.getResultCode(), someIntent); composerTest.assertNoErrors() .assertSubscribed() .assertComplete() .assertValueCount(1) .assertValue(testResult); }
public <T> ObservableTransformer<T, ActivityResult> composer(final Intent intent) { return new ObservableTransformer<T, ActivityResult>() { @Override public ObservableSource<ActivityResult> apply(@NonNull Observable<T> upstream) { return request(upstream, intent); } }; }
RxActivityResults { public <T> ObservableTransformer<T, ActivityResult> composer(final Intent intent) { return new ObservableTransformer<T, ActivityResult>() { @Override public ObservableSource<ActivityResult> apply(@NonNull Observable<T> upstream) { return request(upstream, intent); } }; } }
RxActivityResults { public <T> ObservableTransformer<T, ActivityResult> composer(final Intent intent) { return new ObservableTransformer<T, ActivityResult>() { @Override public ObservableSource<ActivityResult> apply(@NonNull Observable<T> upstream) { return request(upstream, intent); } }; } RxActivityResults(@NonNull Activity activity); }
RxActivityResults { public <T> ObservableTransformer<T, ActivityResult> composer(final Intent intent) { return new ObservableTransformer<T, ActivityResult>() { @Override public ObservableSource<ActivityResult> apply(@NonNull Observable<T> upstream) { return request(upstream, intent); } }; } RxActivityResults(@NonNull Activity activity); ObservableTransformer<T, ActivityResult> composer(final Intent intent); ObservableTransformer<T, Boolean> ensureOkResult(final Intent intent); Observable<ActivityResult> start(Intent intent); void setLogging(boolean logging); }
RxActivityResults { public <T> ObservableTransformer<T, ActivityResult> composer(final Intent intent) { return new ObservableTransformer<T, ActivityResult>() { @Override public ObservableSource<ActivityResult> apply(@NonNull Observable<T> upstream) { return request(upstream, intent); } }; } RxActivityResults(@NonNull Activity activity); ObservableTransformer<T, ActivityResult> composer(final Intent intent); ObservableTransformer<T, Boolean> ensureOkResult(final Intent intent); Observable<ActivityResult> start(Intent intent); void setLogging(boolean logging);  }