当前位置: 首页>>代码示例>>Java>>正文


Java LifecycleTransformer类代码示例

本文整理汇总了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");
    }

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RxUtils.java

示例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");
}
 
开发者ID:kobakei,项目名称:Anago,代码行数:8,代码来源:CustomViewViewModel.java

示例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");
}
 
开发者ID:kobakei,项目名称:Anago,代码行数:8,代码来源:FragmentViewModel.java

示例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");
}
 
开发者ID:kobakei,项目名称:Anago,代码行数:8,代码来源:ActivityViewModel.java

示例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);
}
 
开发者ID:VictorAlbertos,项目名称:RxLifecycleInterop,代码行数:11,代码来源:Rx2LifecycleAndroid.java

示例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);
}
 
开发者ID:VictorAlbertos,项目名称:RxLifecycleInterop,代码行数:11,代码来源:Rx2LifecycleAndroid.java

示例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();
    }
}
 
开发者ID:Redgram,项目名称:redgram-for-reddit,代码行数:8,代码来源:RxHelper.java

示例8: bindToLife

import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <T> LifecycleTransformer<T> bindToLife() {
    return this.<T>bindToLifecycle();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:BaseActivity.java

示例9: bindLife

import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <t> LifecycleTransformer<t> bindLife() {
    return bindToLifecycle();
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:5,代码来源:BaseActivity.java

示例10: bindLife

import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
public <T> LifecycleTransformer<T> bindLife() {
        return bindToLifecycle();
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:5,代码来源:BaseFragment.java

示例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);
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:7,代码来源:BaseActivity.java

示例12: bindToLifecycle

import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    return RxLifecycle.bindActivity(lifecycleSubject);
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:7,代码来源:BaseActivity.java

示例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);
}
 
开发者ID:Popalay,项目名称:RxLifecycleMoxy,代码行数:6,代码来源:RxLifecyclePresenter.java

示例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);
}
 
开发者ID:Popalay,项目名称:RxLifecycleMoxy,代码行数:7,代码来源:RxPresenter.java

示例15: bindToLifecycle

import com.trello.rxlifecycle.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <K> LifecycleTransformer<K> bindToLifecycle() {
    return RxLifecyclePresenter.bindPresenter(lifecycleSubject);
}
 
开发者ID:Popalay,项目名称:RxLifecycleMoxy,代码行数:7,代码来源:RxPresenter.java


注:本文中的com.trello.rxlifecycle.LifecycleTransformer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。