本文整理汇总了Java中com.jess.arms.mvp.IView类的典型用法代码示例。如果您正苦于以下问题:Java IView类的具体用法?Java IView怎么用?Java IView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IView类属于com.jess.arms.mvp包,在下文中一共展示了IView类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applySchedulers
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> ObservableTransformer<T, T> applySchedulers(final IView view) {
return new ObservableTransformer<T, T>() {
@Override
public Observable<T> apply(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(@NonNull Disposable disposable) throws Exception {
view.showLoading();//显示进度条
}
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(new Action() {
@Override
public void run() {
view.hideLoading();//隐藏进度条
}
}).compose(RxLifecycleUtils.bindToLifecycle(view));
}
};
}
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:23,代码来源:RxUtils.java
示例2: applySchedulers
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> ObservableTransformer<T, T> applySchedulers(final IView view,final boolean isLoadMore) {
return new ObservableTransformer<T, T>() {
@Override
public Observable<T> apply(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(@NonNull Disposable disposable) throws Exception {
if (!isLoadMore){
view.showLoading();
}
}
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(new Action() {
@Override
public void run() {
view.hideLoading();//隐藏进度条
}
}).compose(RxLifecycleUtils.bindToLifecycle(view));
}
};
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:25,代码来源:RxUtils.java
示例3: applySchedulersWithLifeCycle
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> ObservableTransformer<T, T> applySchedulersWithLifeCycle(IView view) {
return new ObservableTransformer<T, T>() {
@Override
public Observable<T> apply(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(new Action() {
@Override
public void run() {
view.hideLoading();//隐藏进度条
}
})
.compose(RxLifecycleUtils.bindToLifecycle(view));
}
};
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:17,代码来源:RxUtils.java
示例4: applySchedulers
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> ObservableTransformer<T, T> applySchedulers(final IView view) {
return new ObservableTransformer<T, T>() {
@Override
public Observable<T> apply(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(@NonNull Disposable disposable) throws Exception {
view.showLoading();//显示进度条
}
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(new Action() {
@Override
public void run() {
view.hideLoading();//隐藏进度条
}
}).compose(RxUtils.bindToLifecycle(view));
}
};
}
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:23,代码来源:RxUtils.java
示例5: externalStorage
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 请求外部存储的权限
*/
public static void externalStorage(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过摄像头,和写入外部存储的权限
boolean isPermissionsGranted =
rxPermissions
.isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (isPermissionsGranted) {//已经申请过,直接执行操作
requestPermission.onRequestPermissionSuccess();
} else {//没有申请过,则申请
rxPermissions
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
@Override
public void onNext(Boolean granted) {
if (granted) {
Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
requestPermission.onRequestPermissionSuccess();
} else {
view.showMessage("request permissons failure");
}
}
});
}
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java
示例6: sendSms
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 请求发送短信权限
*/
public static void sendSms(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
boolean isPermissionsGranted =
rxPermissions
.isGranted(Manifest.permission.SEND_SMS);
if (isPermissionsGranted) {//已经申请过,直接执行操作
requestPermission.onRequestPermissionSuccess();
} else {//没有申请过,则申请
rxPermissions
.request(Manifest.permission.SEND_SMS)
.subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
@Override
public void onNext(Boolean granted) {
if (granted) {
Timber.tag(TAG).d("request SEND_SMS success");
requestPermission.onRequestPermissionSuccess();
} else {
view.showMessage("request permissons failure");
}
}
});
}
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java
示例7: callPhone
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 请求打电话权限
*/
public static void callPhone(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过权限
boolean isPermissionsGranted =
rxPermissions
.isGranted(Manifest.permission.CALL_PHONE);
if (isPermissionsGranted) {//已经申请过,直接执行操作
requestPermission.onRequestPermissionSuccess();
} else {//没有申请过,则申请
rxPermissions
.request(Manifest.permission.CALL_PHONE)
.subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
@Override
public void onNext(Boolean granted) {
if (granted) {
Timber.tag(TAG).d("request SEND_SMS success");
requestPermission.onRequestPermissionSuccess();
} else {
view.showMessage("request permissons failure");
}
}
});
}
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:28,代码来源:PermissionUtil.java
示例8: applySchedulers
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> ObservableTransformer<T, T> applySchedulers(final IView view) {
return new ObservableTransformer<T,T>() {
@Override
public Observable<T> apply(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.doOnSubscribe(new Consumer<Disposable>() {
@Override
public void accept(@NonNull Disposable disposable) throws Exception {
view.showLoading();//显示进度条
}
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(new Action() {
@Override
public void run() throws Exception {
view.hideLoading();//隐藏进度条
}
});
}
};
}
开发者ID:JessYanCoding,项目名称:WideEyes,代码行数:23,代码来源:RxUtils.java
示例9: bindUntilEvent
import com.jess.arms.mvp.IView; //导入依赖的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
示例10: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的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
示例11: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的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
示例12: launchCamera
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 请求摄像头权限
*/
public static void launchCamera(final RequestPermission requestPermission, RxPermissions rxPermissions, final IView view, RxErrorHandler errorHandler) {
//先确保是否已经申请过摄像头,和写入外部存储的权限
boolean isPermissionsGranted =
rxPermissions
.isGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE) &&
rxPermissions
.isGranted(Manifest.permission.CAMERA);
if (isPermissionsGranted) {//已经申请过,直接执行操作
requestPermission.onRequestPermissionSuccess();
} else {//没有申请过,则申请
rxPermissions
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE
, Manifest.permission.CAMERA)
.subscribe(new ErrorHandleSubscriber<Boolean>(errorHandler) {
@Override
public void onNext(Boolean granted) {
if (granted) {
Timber.tag(TAG).d("request WRITE_EXTERNAL_STORAGE and CAMERA success");
requestPermission.onRequestPermissionSuccess();
} else {
view.showMessage("request permissons failure");
}
}
});
}
}
开发者ID:hshare,项目名称:MVPArmsTest1,代码行数:31,代码来源:PermissionUtil.java
示例13: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的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
示例14: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 此接口已废弃
*
* @param view
* @param <T>
* @return
* @see RxLifecycleUtils 使用此类代替
*/
@Deprecated
public static <T> LifecycleTransformer<T> bindToLifecycle(IView view) {
return RxLifecycleUtils.bindToLifecycle(view);
}
开发者ID:Superingxz,项目名称:MoligyMvpArms,代码行数:13,代码来源:RxUtils.java
示例15: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的package包/类
public static <T> LifecycleTransformer<T> bindToLifecycle(IView view) {
return RxLifecycleUtils.bindToLifecycle(view);
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:5,代码来源:RxUtils.java
示例16: bindToLifecycle
import com.jess.arms.mvp.IView; //导入依赖的package包/类
/**
* 此方法已废弃
*
* @param view
* @param <T>
* @return
* @see RxLifecycleUtils 此类可以实现 {@link RxLifecycle} 的所有功能, 使用方法和之前一致
* @deprecated Use {@link RxLifecycleUtils#bindToLifecycle(IView)} instead
*/
@Deprecated
public static <T> LifecycleTransformer<T> bindToLifecycle(IView view) {
return RxLifecycleUtils.bindToLifecycle(view);
}
开发者ID:JessYanCoding,项目名称:MVPArms,代码行数:14,代码来源:RxUtils.java
注:本文中的com.jess.arms.mvp.IView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论