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


Java LifecycleTransformer类代码示例

本文整理汇总了Java中com.trello.rxlifecycle2.LifecycleTransformer的典型用法代码示例。如果您正苦于以下问题:Java LifecycleTransformer类的具体用法?Java LifecycleTransformer怎么用?Java LifecycleTransformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LifecycleTransformer类属于com.trello.rxlifecycle2包,在下文中一共展示了LifecycleTransformer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindUntilEvent

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
/**
 * 绑定 Activity 的指定生命周期
 *
 * @param view
 * @param event
 * @param <T>
 * @return
 */
public static <T> LifecycleTransformer<T> bindUntilEvent(@NonNull final IView view,
                                                         final ActivityEvent event) {
    Preconditions.checkNotNull(view, "view == null");
    if (view instanceof ActivityLifecycleable) {
        return bindUntilEvent((ActivityLifecycleable) view, event);
    } else {
        throw new IllegalArgumentException("view isn't ActivityLifecycleable");
    }
}
 
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:18,代码来源:RxLifecycleUtils.java

示例2: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
/**
 * 绑定 Activity/Fragment 的生命周期
 *
 * @param view
 * @param <T>
 * @return
 */
public static <T> LifecycleTransformer<T> bindToLifecycle(@NonNull IView view) {
    Preconditions.checkNotNull(view, "view == null");
    if (view instanceof Lifecycleable) {
        return bindToLifecycle((Lifecycleable) view);
    } else {
        throw new IllegalArgumentException("view isn't Lifecycleable");
    }
}
 
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:16,代码来源:RxLifecycleUtils.java

示例3: bindUntilLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override public <T>LifecycleTransformer<T> bindUntilLifecycle(FragmentEvent event) {
  ActivityEvent activityEvent;
  switch (event.name()) {
    case "DESTROY_VIEW":
    case "DETACH":
      activityEvent = ActivityEvent.DESTROY;
      break;
    default:
      activityEvent = ActivityEvent.valueOf(event.name());
      break;
  }

  return view.getUseActivity().bindUntilEvent(activityEvent);
}
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:15,代码来源:BaseActivityPresenter.java

示例4: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
public static <T> LifecycleTransformer<T> bindToLifecycle(IView view) {
    if (view instanceof LifecycleProvider){
        return ((LifecycleProvider)view).bindToLifecycle();
    }else {
        throw new IllegalArgumentException("view isn't activity or fragment");
    }

}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:9,代码来源:RxUtils.java

示例5: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
public static <T> LifecycleTransformer<T> bindToLifecycle(IView view) {
    if (view instanceof RxAppCompatActivity) {
        return ((RxAppCompatActivity) view).bindToLifecycle();
    } else if (view instanceof RxFragment) {
        return ((RxFragment) view).bindToLifecycle();
    } else {
        throw new IllegalArgumentException("view isn't activity or fragment");
    }

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

示例6: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindToLifecycle() {
    //return RxLifecycleAndroid.bindActivity(lifecycleSubject);
    return bindUntilEvent(ActivityEvent.DESTROY);
}
 
开发者ID:ImKarl,项目名称:JianshuApp,代码行数:8,代码来源:RxLifecycleActivity.java

示例7: bindUntilEvent

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <T> LifecycleTransformer<T> bindUntilEvent(@NonNull ActivityEvent event) {
    return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
 
开发者ID:chenzj-king,项目名称:RetrofitSample,代码行数:7,代码来源:BaseCompatActivity.java

示例8: bindToLifecycle

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

示例9: RxSchedulers

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
public RxSchedulers(LifecycleTransformer lifecycle){
    this.lifecycle=lifecycle;
}
 
开发者ID:JJS-CN,项目名称:JBase,代码行数:4,代码来源:RxSchedulers.java

示例10: getInstance

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
public static RxSchedulers getInstance(LifecycleTransformer lifecycle){
    return new RxSchedulers(lifecycle);
}
 
开发者ID:JJS-CN,项目名称:JBase,代码行数:4,代码来源:RxSchedulers.java

示例11: bindUntilEvent

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <X> LifecycleTransformer<X> bindUntilEvent(@NonNull ControllerEvent event) {
  return RxLifecycle.bindUntilEvent(lifecycleSubject, event);
}
 
开发者ID:bangarharshit,项目名称:ConductorMVP,代码行数:7,代码来源:RxBaseController.java

示例12: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override
@NonNull
@CheckResult
public final <X> LifecycleTransformer<X> bindToLifecycle() {
  return RxControllerLifecycle.bindController(lifecycleSubject);
}
 
开发者ID:bangarharshit,项目名称:ConductorMVP,代码行数:7,代码来源:RxBaseController.java

示例13: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override public <T>LifecycleTransformer<T> bindToLifecycle() {
  return view.getUseActivity().bindToLifecycle();
}
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:4,代码来源:BaseActivityPresenter.java

示例14: bindToLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override public <T> LifecycleTransformer<T> bindToLifecycle() {
  return view.getUseFragment().bindToLifecycle();
}
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:4,代码来源:BaseFragmentPresenter.java

示例15: bindUntilLifecycle

import com.trello.rxlifecycle2.LifecycleTransformer; //导入依赖的package包/类
@Override public <T> LifecycleTransformer<T> bindUntilLifecycle(FragmentEvent event) {
  return view.getUseFragment().bindUntilEvent(event);
}
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:4,代码来源:BaseFragmentPresenter.java


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