@Test public void itSupportsFragmentsFromTheSupportV4Library() { AndroidObservable.fromFragment(supportFragment, Observable.just("success")).subscribe(new TestObserver<String>(observer)); verify(observer).onNext("success"); verify(observer).onCompleted(); }
public static <T> Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable) { if (USES_SUPPORT_FRAGMENTS && fragment instanceof android.support.v4.app.Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (android.support.v4.app.Fragment) fragment); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && fragment instanceof Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (Fragment) fragment); } else { throw new IllegalArgumentException("Target fragment is neither a native nor support library Fragment"); } }
AndroidObservable { public static <T> Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable) { if (USES_SUPPORT_FRAGMENTS && fragment instanceof android.support.v4.app.Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (android.support.v4.app.Fragment) fragment); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && fragment instanceof Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (Fragment) fragment); } else { throw new IllegalArgumentException("Target fragment is neither a native nor support library Fragment"); } } }
AndroidObservable { public static <T> Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable) { if (USES_SUPPORT_FRAGMENTS && fragment instanceof android.support.v4.app.Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (android.support.v4.app.Fragment) fragment); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && fragment instanceof Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (Fragment) fragment); } else { throw new IllegalArgumentException("Target fragment is neither a native nor support library Fragment"); } } private  AndroidObservable(); }
AndroidObservable { public static <T> Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable) { if (USES_SUPPORT_FRAGMENTS && fragment instanceof android.support.v4.app.Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (android.support.v4.app.Fragment) fragment); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && fragment instanceof Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (Fragment) fragment); } else { throw new IllegalArgumentException("Target fragment is neither a native nor support library Fragment"); } } private  AndroidObservable(); static Observable<T> fromActivity(Activity activity, Observable<T> sourceObservable); static Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable); }
AndroidObservable { public static <T> Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable) { if (USES_SUPPORT_FRAGMENTS && fragment instanceof android.support.v4.app.Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (android.support.v4.app.Fragment) fragment); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && fragment instanceof Fragment) { return OperationObserveFromAndroidComponent.observeFromAndroidComponent(sourceObservable, (Fragment) fragment); } else { throw new IllegalArgumentException("Target fragment is neither a native nor support library Fragment"); } } private  AndroidObservable(); static Observable<T> fromActivity(Activity activity, Observable<T> sourceObservable); static Observable<T> fromFragment(Object fragment, Observable<T> sourceObservable);  }