Java Code Examples for com.trello.rxlifecycle2.android.RxLifecycleAndroid#bindFragment()

The following examples show how to use com.trello.rxlifecycle2.android.RxLifecycleAndroid#bindFragment() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RxLifecycleUtils.java    From Aurora with Apache License 2.0 5 votes vote down vote up
public static <T> LifecycleTransformer<T> bindToLifecycle(@NonNull Lifecycleable lifecycleable) {
    Preconditions.checkNotNull(lifecycleable, "lifecycleable == null");
    if (lifecycleable instanceof ActivityLifecycleable) {
        return RxLifecycleAndroid.bindActivity(((ActivityLifecycleable) lifecycleable).provideLifecycleSubject());
    } else if (lifecycleable instanceof FragmentLifecycleable) {
        return RxLifecycleAndroid.bindFragment(((FragmentLifecycleable) lifecycleable).provideLifecycleSubject());
    } else {
        throw new IllegalArgumentException("Lifecycleable not match");
    }
}
 
Example 2
Source File: RxLifecycleUtils.java    From MVPArms with Apache License 2.0 5 votes vote down vote up
public static <T> LifecycleTransformer<T> bindToLifecycle(@NonNull Lifecycleable lifecycleable) {
    Preconditions.checkNotNull(lifecycleable, "lifecycleable == null");
    if (lifecycleable instanceof ActivityLifecycleable) {
        return RxLifecycleAndroid.bindActivity(((ActivityLifecycleable) lifecycleable).provideLifecycleSubject());
    } else if (lifecycleable instanceof FragmentLifecycleable) {
        return RxLifecycleAndroid.bindFragment(((FragmentLifecycleable) lifecycleable).provideLifecycleSubject());
    } else {
        throw new IllegalArgumentException("Lifecycleable not match");
    }
}
 
Example 3
Source File: BaseDialogFragment.java    From QuickDevFramework with Apache License 2.0 4 votes vote down vote up
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    return RxLifecycleAndroid.bindFragment(lifecycleSubject);
}
 
Example 4
Source File: BaseFragment.java    From QuickDevFramework with Apache License 2.0 4 votes vote down vote up
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    return RxLifecycleAndroid.bindFragment(lifecycleSubject);
}
 
Example 5
Source File: SuperFragment.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    return RxLifecycleAndroid.bindFragment(mLifecycleSubject);
}
 
Example 6
Source File: RxLifecycleProvider.java    From NGA-CLIENT-VER-OPEN-SOURCE with GNU General Public License v2.0 4 votes vote down vote up
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    return RxLifecycleAndroid.bindFragment(mLifecycleSubject);
}