本文整理汇总了Java中com.trello.rxlifecycle.android.RxLifecycleAndroid.bindActivity方法的典型用法代码示例。如果您正苦于以下问题:Java RxLifecycleAndroid.bindActivity方法的具体用法?Java RxLifecycleAndroid.bindActivity怎么用?Java RxLifecycleAndroid.bindActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.trello.rxlifecycle.android.RxLifecycleAndroid
的用法示例。
在下文中一共展示了RxLifecycleAndroid.bindActivity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindActivity
import com.trello.rxlifecycle.android.RxLifecycleAndroid; //导入方法依赖的package包/类
@NonNull
@CheckResult
public static <T> LifecycleTransformer2x<T> bindActivity(
@NonNull final Observable<ActivityEvent> lifecycle,
@NonNull final BackpressureStrategy strategy) {
LifecycleTransformer<T> rxTransformer =
RxLifecycleAndroid.bindActivity(RxJavaInterop.toV1Observable(lifecycle, strategy));
return new LifecycleTransformer2xBehaviour<>(rxTransformer, rxTransformer.forSingle(),
strategy);
}
示例2: bindToLifecycle
import com.trello.rxlifecycle.android.RxLifecycleAndroid; //导入方法依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(lifecycleSubject);
}
示例3: bindToLifecycle
import com.trello.rxlifecycle.android.RxLifecycleAndroid; //导入方法依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(activityLifecycleEvent);
}
示例4: bindToLifecycle
import com.trello.rxlifecycle.android.RxLifecycleAndroid; //导入方法依赖的package包/类
/**
* Completes an observable when the lifecycle event opposing the current lifecyle event is emitted.
* For example, if a subscription is made during {@link ActivityEvent#CREATE}, the observable will be completed
* in {@link ActivityEvent#DESTROY}.
*/
public <T> Observable.Transformer<T, T> bindToLifecycle() {
return RxLifecycleAndroid.bindActivity(lifecycle);
}