Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
MVPArms
提交
ac8a570b
M
MVPArms
项目概览
门心叼龙
/
MVPArms
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MVPArms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac8a570b
编写于
11月 08, 2017
作者:
J
jessyan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve Demo
上级
4d9cc56f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
18 deletion
+36
-18
app/src/main/java/me/jessyan/mvparms/demo/app/utils/RxUtils.java
.../main/java/me/jessyan/mvparms/demo/app/utils/RxUtils.java
+4
-2
app/src/main/java/me/jessyan/mvparms/demo/mvp/ui/activity/UserActivity.java
...me/jessyan/mvparms/demo/mvp/ui/activity/UserActivity.java
+1
-1
arms/src/main/java/com/jess/arms/utils/ArmsUtils.java
arms/src/main/java/com/jess/arms/utils/ArmsUtils.java
+31
-15
未找到文件。
app/src/main/java/me/jessyan/mvparms/demo/app/utils/RxUtils.java
浏览文件 @
ac8a570b
...
...
@@ -18,6 +18,7 @@ package me.jessyan.mvparms.demo.app.utils;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.trello.rxlifecycle2.LifecycleTransformer
;
import
com.trello.rxlifecycle2.RxLifecycle
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableTransformer
;
...
...
@@ -66,12 +67,13 @@ public class RxUtils {
}
/**
* 此
接口
已废弃
* 此
方法
已废弃
*
* @param view
* @param <T>
* @return
* @see RxLifecycleUtils 使用此类代替
* @see RxLifecycleUtils 此类可以实现 {@link RxLifecycle} 的所有功能, 使用方法和之前一致
* @deprecated Use {@link RxLifecycleUtils#bindToLifecycle(IView)} instead
*/
@Deprecated
public
static
<
T
>
LifecycleTransformer
<
T
>
bindToLifecycle
(
IView
view
)
{
...
...
app/src/main/java/me/jessyan/mvparms/demo/mvp/ui/activity/UserActivity.java
浏览文件 @
ac8a570b
...
...
@@ -98,7 +98,7 @@ public class UserActivity extends BaseActivity<UserPresenter> implements UserCon
*/
private
void
initRecyclerView
()
{
mSwipeRefreshLayout
.
setOnRefreshListener
(
this
);
ArmsUtils
.
configRecycleView
(
mRecyclerView
,
mLayoutManager
);
ArmsUtils
.
configRecycle
r
View
(
mRecyclerView
,
mLayoutManager
);
}
...
...
arms/src/main/java/com/jess/arms/utils/ArmsUtils.java
浏览文件 @
ac8a570b
/**
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* Copyright 2017 JessYan
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.jess.arms.utils
;
import
android.app.Activity
;
...
...
@@ -399,11 +399,13 @@ public class ArmsUtils {
/**
* 配置
recyclev
iew
* 配置
RecyclerV
iew
*
* @param recyclerView
* @param layoutManager
* @deprecated Use {@link #configRecyclerView(RecyclerView, RecyclerView.LayoutManager)} instead
*/
@Deprecated
public
static
void
configRecycleView
(
final
RecyclerView
recyclerView
,
RecyclerView
.
LayoutManager
layoutManager
)
{
recyclerView
.
setLayoutManager
(
layoutManager
);
...
...
@@ -412,6 +414,20 @@ public class ArmsUtils {
recyclerView
.
setItemAnimator
(
new
DefaultItemAnimator
());
}
/**
* 配置 RecyclerView
*
* @param recyclerView
* @param layoutManager
*/
public
static
void
configRecyclerView
(
final
RecyclerView
recyclerView
,
RecyclerView
.
LayoutManager
layoutManager
)
{
recyclerView
.
setLayoutManager
(
layoutManager
);
//如果可以确定每个item的高度是固定的,设置这个选项可以提高性能
recyclerView
.
setHasFixedSize
(
true
);
recyclerView
.
setItemAnimator
(
new
DefaultItemAnimator
());
}
/**
* 远程遥控 {@link AppManager#killAll()}
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录