本文整理汇总了Java中com.trello.rxlifecycle.LifecycleTransformer类的典型用法代码示例。如果您正苦于以下问题:Java LifecycleTransformer类的具体用法?Java LifecycleTransformer怎么用?Java LifecycleTransformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LifecycleTransformer类属于com.trello.rxlifecycle包,在下文中一共展示了LifecycleTransformer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
public static <T> LifecycleTransformer<T> bindToLifecycle(BaseView view) {
if (view instanceof BaseActivity) {
return ((BaseActivity) view).<T>bindToLifecycle();
} else if (view instanceof BaseFragment) {
return ((BaseFragment) view).<T>bindToLifecycle();
} else {
throw new IllegalArgumentException("view isn't activity or fragment");
}
}
示例2: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@NonNull
public final <T> LifecycleTransformer<T> bindToLifecycle() {
if (view != null) {
return RxLifecycleAndroid.bindView(view);
}
throw new IllegalStateException("No view attached");
}
示例3: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@NonNull
public final <T> LifecycleTransformer<T> bindToLifecycle() {
if (fragment != null) {
return fragment.bindToLifecycle();
}
throw new IllegalStateException("No view attached");
}
示例4: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@NonNull
public final <T> LifecycleTransformer<T> bindToLifecycle() {
if (activity != null) {
return activity.bindToLifecycle();
}
throw new IllegalStateException("No view attached");
}
示例5: bindActivity
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的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);
}
示例6: bindFragment
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@NonNull
@CheckResult
public static <T> LifecycleTransformer2x<T> bindFragment(
@NonNull final Observable<FragmentEvent> lifecycle,
@NonNull final BackpressureStrategy strategy) {
LifecycleTransformer<T> rxTransformer =
RxLifecycleAndroid.bindFragment(RxJavaInterop.toV1Observable(lifecycle, strategy));
return new LifecycleTransformer2xBehaviour<>(rxTransformer, rxTransformer.forSingle(),
strategy);
}
示例7: transformer
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
public static LifecycleTransformer transformer(BaseContextView contextView) {
if(contextView instanceof BaseActivity){
return contextView.getBaseActivity().bindToLifecycle();
}else{
return contextView.getBaseFragment().bindToLifecycle();
}
}
示例8: bindToLife
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <T> LifecycleTransformer<T> bindToLife() {
return this.<T>bindToLifecycle();
}
示例9: bindLife
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <t> LifecycleTransformer<t> bindLife() {
return bindToLifecycle();
}
示例10: bindLife
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <T> LifecycleTransformer<T> bindLife() {
return bindToLifecycle();
}
示例11: bindUntilEvent
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull ActivityEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
示例12: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
return RxLifecycle.bindActivity(lifecycleSubject);
}
示例13: bindPresenter
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@NonNull
@CheckResult
public static <T> LifecycleTransformer<T> bindPresenter(@NonNull final Observable<PresenterEvent> lifecycle) {
return bind(lifecycle, PRESENTER_LIFECYCLE);
}
示例14: bindUntilEvent
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <K> LifecycleTransformer<K> bindUntilEvent(@NonNull PresenterEvent event) {
return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
示例15: bindToLifecycle
import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <K> LifecycleTransformer<K> bindToLifecycle() {
return RxLifecyclePresenter.bindPresenter(lifecycleSubject);
}