Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_40328769
BaseRecyclerViewAdapterHelper
提交
35614212
B
BaseRecyclerViewAdapterHelper
项目概览
qq_40328769
/
BaseRecyclerViewAdapterHelper
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
BaseRecyclerViewAdapterHelper
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
35614212
编写于
2月 25, 2020
作者:
limuyang2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update README
上级
c7c4ddad
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
18 addition
and
18 deletion
+18
-18
readme/0-BaseRecyclerViewAdapterHelper.md
readme/0-BaseRecyclerViewAdapterHelper.md
+1
-1
readme/1-BaseQuickAdapter.md
readme/1-BaseQuickAdapter.md
+6
-6
readme/3-DataBinding.md
readme/3-DataBinding.md
+2
-2
readme/4-多布局.md
readme/4-多布局.md
+4
-4
readme/5-BaseSectionQuickAdapter.md
readme/5-BaseSectionQuickAdapter.md
+4
-4
readme/6-BaseNodeAdapter.md
readme/6-BaseNodeAdapter.md
+1
-1
未找到文件。
readme/0-BaseRecyclerViewAdapterHelper.md
浏览文件 @
35614212
...
...
@@ -26,7 +26,7 @@ allprojects {
[
![
](
https://jitpack.io/v/CymChad/BaseRecyclerViewAdapterHelper.svg
)
](https://jitpack.io/#CymChad/BaseRecyclerViewAdapterHelper)
```
dependencies {
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.0
-beta11
'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.0'
}
```
...
...
readme/1-BaseQuickAdapter.md
浏览文件 @
35614212
...
...
@@ -29,7 +29,7 @@ public class DemoAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
* 在此方法中设置item数据
*/
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
String
item
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
String
item
)
{
helper
.
setText
(
R
.
id
.
tweetName
,
"This is an Item, pos: "
+
(
helper
.
getAdapterPosition
()
-
getHeaderLayoutCount
()));
}
}
...
...
@@ -72,7 +72,7 @@ public class DemoAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
String
item
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
String
item
)
{
...
}
}
...
...
@@ -90,7 +90,7 @@ DemoAdapter adapter = new DemoAdapter();
// 设置点击事件
adapter
.
setOnItemClickListener
(
new
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
void
onItemClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
Tips
.
show
(
"onItemClick "
+
position
);
}
});
...
...
@@ -105,7 +105,7 @@ adapter.setOnItemClickListener(new OnItemClickListener() {
```
java
adapter
.
setOnItemLongClickListener
(
new
OnItemLongClickListener
()
{
@Override
public
boolean
onItemLongClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
boolean
onItemLongClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
Tips
.
show
(
"onItemLongClick "
+
position
);
return
true
;
}
...
...
@@ -122,7 +122,7 @@ adapter.addChildClickViewIds(R.id.btn, R.id.iv_num_add, R.id.item_click);
// 设置子控件点击监听
adapter
.
setOnItemChildClickListener
(
new
OnItemChildClickListener
()
{
@Override
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
void
onItemChildClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
if
(
view
.
getId
()
==
R
.
id
.
btn
)
{
Tips
.
show
(
"onItemChildClick "
+
position
);
}
...
...
@@ -138,7 +138,7 @@ adapter.addChildLongClickViewIds(R.id.btn, R.id.iv_num_add, R.id.item_click);
// 设置子控件长按监听
adapter
.
setOnItemChildLongClickListener
(
new
OnItemChildLongClickListener
()
{
@Override
public
boolean
onItemChildLongClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
boolean
onItemChildLongClick
(
@NonNull
BaseQuickAdapter
adapter
,
@NonNull
View
view
,
int
position
)
{
if
(
view
.
getId
()
==
R
.
id
.
btn
)
{
Tips
.
show
(
"onItemChildLongClick "
+
position
);
}
...
...
readme/3-DataBinding.md
浏览文件 @
35614212
...
...
@@ -24,7 +24,7 @@ public class DataBindingAdapter extends BaseQuickAdapter<Movie, BaseViewHolder>
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
Movie
item
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
Movie
item
)
{
if
(
item
==
null
)
{
return
;
}
...
...
@@ -105,7 +105,7 @@ public class ImgItemProvider extends BaseItemProvider<ProviderMultiEntity> {
}
@Override
public
void
convert
(
@No
nNull
BaseViewHolder
helper
,
@Nullable
ProviderMultiEntity
data
)
{
public
void
convert
(
@No
tNull
BaseViewHolder
helper
,
@NotNull
ProviderMultiEntity
data
)
{
Movie
movie
=
data
.
getMovie
();
// 获取 Binding
ItemMovieBinding
binding
=
helper
.
getBinding
();
...
...
readme/4-多布局.md
浏览文件 @
35614212
...
...
@@ -103,7 +103,7 @@ public class DelegateMultiAdapter extends BaseDelegateMultiAdapter<DelegateMulti
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
DelegateMultiEntity
item
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
DelegateMultiEntity
item
)
{
switch
(
helper
.
getItemViewType
())
{
case
QuickMultipleEntity
.
TEXT
:
helper
.
setText
(
R
.
id
.
tv
,
"CymChad "
+
helper
.
getAdapterPosition
());
...
...
@@ -141,7 +141,7 @@ public class DelegateMultiAdapter extends BaseDelegateMultiAdapter<DelegateMulti
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
DelegateMultiEntity
item
)
{
protected
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
DelegateMultiEntity
item
)
{
switch
(
helper
.
getItemViewType
())
{
case
QuickMultipleEntity
.
TEXT
:
helper
.
setText
(
R
.
id
.
tv
,
"CymChad "
+
helper
.
getAdapterPosition
());
...
...
@@ -261,7 +261,7 @@ public class ImgItemProvider extends BaseItemProvider<ProviderMultiEntity> {
}
@Override
public
void
convert
(
@No
nNull
BaseViewHolder
helper
,
@Nullable
ProviderMultiEntity
data
)
{
public
void
convert
(
@No
tNull
BaseViewHolder
helper
,
@NotNull
ProviderMultiEntity
data
)
{
// 设置 item 数据
if
(
helper
.
getAdapterPosition
()
%
2
==
0
)
{
helper
.
setImageResource
(
R
.
id
.
iv
,
R
.
mipmap
.
animation_img1
);
...
...
@@ -272,7 +272,7 @@ public class ImgItemProvider extends BaseItemProvider<ProviderMultiEntity> {
// 点击 item 事件
@Override
public
void
onClick
(
@No
n
Null
BaseViewHolder
helper
,
@NotNull
View
view
,
ProviderMultiEntity
data
,
int
position
)
{
public
void
onClick
(
@No
t
Null
BaseViewHolder
helper
,
@NotNull
View
view
,
ProviderMultiEntity
data
,
int
position
)
{
Tips
.
show
(
"Click: "
+
position
);
}
...
...
readme/5-BaseSectionQuickAdapter.md
浏览文件 @
35614212
...
...
@@ -42,14 +42,14 @@ public class SectionQuickAdapter extends BaseSectionQuickAdapter<MySection, Base
* 设置header数据
*/
@Override
protected
void
convertHeader
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
MySection
item
)
{
protected
void
convertHeader
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
MySection
item
)
{
if
(
item
!=
null
&&
item
.
getObject
()
instanceof
String
)
{
helper
.
setText
(
R
.
id
.
header
,
(
String
)
item
.
getObject
());
}
}
@Override
protected
void
convert
(
@No
n
Null
BaseViewHolder
helper
,
MySection
item
)
{
protected
void
convert
(
@No
t
Null
BaseViewHolder
helper
,
MySection
item
)
{
//设置item数据
Video
video
=
(
Video
)
item
.
getObject
();
helper
.
setText
(
R
.
id
.
tv
,
video
.
getName
());
...
...
@@ -131,11 +131,11 @@ public class SectionQuickAdapter extends BaseSectionQuickAdapter<MySection, Base
* 设置header数据
*/
@Override
protected
void
convertHeader
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
MySection
item
)
{
protected
void
convertHeader
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
MySection
item
)
{
}
@Override
protected
void
convert
(
@No
n
Null
BaseViewHolder
helper
,
MySection
item
)
{
protected
void
convert
(
@No
t
Null
BaseViewHolder
helper
,
MySection
item
)
{
//设置item数据
}
}
...
...
readme/6-BaseNodeAdapter.md
浏览文件 @
35614212
...
...
@@ -58,7 +58,7 @@ public class RootNodeProvider extends BaseNodeProvider {
}
@Override
public
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
ullable
BaseNode
data
)
{
public
void
convert
(
@NotNull
BaseViewHolder
helper
,
@N
otNull
BaseNode
data
)
{
// 数据类型需要自己强转
RootNode
entity
=
(
RootNode
)
data
;
helper
.
setText
(
R
.
id
.
header
,
entity
.
getTitle
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录