Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_40328769
BaseRecyclerViewAdapterHelper
提交
e4234c12
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,发现更多精彩内容 >>
提交
e4234c12
编写于
4月 11, 2020
作者:
limuyang2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- add removeAt()
上级
fdf8ab50
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
17 addition
and
7 deletion
+17
-7
build.gradle
build.gradle
+2
-2
library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt
...ain/java/com/chad/library/adapter/base/BaseNodeAdapter.kt
+4
-4
library/src/main/java/com/chad/library/adapter/base/BaseProviderMultiAdapter.kt
...com/chad/library/adapter/base/BaseProviderMultiAdapter.kt
+0
-1
library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.kt
...in/java/com/chad/library/adapter/base/BaseQuickAdapter.kt
+11
-0
未找到文件。
build.gradle
浏览文件 @
e4234c12
buildscript
{
buildscript
{
ext
.
kotlin_version
=
'1.3.
6
1'
ext
.
kotlin_version
=
'1.3.
7
1'
repositories
{
repositories
{
google
()
google
()
jcenter
()
jcenter
()
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:3.6.
1
'
classpath
'com.android.tools.build:gradle:3.6.
2
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
}
}
...
...
library/src/main/java/com/chad/library/adapter/base/BaseNodeAdapter.kt
浏览文件 @
e4234c12
...
@@ -103,8 +103,8 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
...
@@ -103,8 +103,8 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
*
*
* @param position Int 整个 data 的 index
* @param position Int 整个 data 的 index
*/
*/
override
fun
remove
(
position
:
Int
)
{
override
fun
remove
At
(
position
:
Int
)
{
val
removeCount
=
removeAt
(
position
)
val
removeCount
=
remove
Nodes
At
(
position
)
notifyItemRangeRemoved
(
position
+
headerLayoutCount
,
removeCount
)
notifyItemRangeRemoved
(
position
+
headerLayoutCount
,
removeCount
)
compatibilityDataSizeChanged
(
0
)
compatibilityDataSizeChanged
(
0
)
}
}
...
@@ -116,7 +116,7 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
...
@@ -116,7 +116,7 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
*/
*/
override
fun
setData
(
index
:
Int
,
data
:
BaseNode
)
{
override
fun
setData
(
index
:
Int
,
data
:
BaseNode
)
{
// 先移除,再添加
// 先移除,再添加
val
removeCount
=
removeAt
(
index
)
val
removeCount
=
remove
Nodes
At
(
index
)
val
newFlatData
=
flatData
(
arrayListOf
(
data
))
val
newFlatData
=
flatData
(
arrayListOf
(
data
))
this
.
data
.
addAll
(
index
,
newFlatData
)
this
.
data
.
addAll
(
index
,
newFlatData
)
...
@@ -152,7 +152,7 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
...
@@ -152,7 +152,7 @@ abstract class BaseNodeAdapter(nodeList: MutableList<BaseNode>? = null)
* @param position Int
* @param position Int
* @return Int 被移除的数量
* @return Int 被移除的数量
*/
*/
private
fun
removeAt
(
position
:
Int
):
Int
{
private
fun
remove
Nodes
At
(
position
:
Int
):
Int
{
if
(
position
>=
data
.
size
)
{
if
(
position
>=
data
.
size
)
{
return
0
return
0
}
}
...
...
library/src/main/java/com/chad/library/adapter/base/BaseProviderMultiAdapter.kt
浏览文件 @
e4234c12
...
@@ -18,7 +18,6 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
...
@@ -18,7 +18,6 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
* @param T data 数据类型
* @param T data 数据类型
* @constructor
* @constructor
*/
*/
@Deprecated
(
"please use Class BaseBinderAdapter"
)
abstract
class
BaseProviderMultiAdapter
<
T
>(
data
:
MutableList
<
T
>?
=
null
)
:
abstract
class
BaseProviderMultiAdapter
<
T
>(
data
:
MutableList
<
T
>?
=
null
)
:
BaseQuickAdapter
<
T
,
BaseViewHolder
>(
0
,
data
)
{
BaseQuickAdapter
<
T
,
BaseViewHolder
>(
0
,
data
)
{
...
...
library/src/main/java/com/chad/library/adapter/base/BaseQuickAdapter.kt
浏览文件 @
e4234c12
...
@@ -1238,7 +1238,18 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
...
@@ -1238,7 +1238,18 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
*
*
* @param position
* @param position
*/
*/
@Deprecated
(
"Please use removeAt()"
,
replaceWith
=
ReplaceWith
(
"removeAt(position)"
))
open
fun
remove
(
@IntRange
(
from
=
0
)
position
:
Int
)
{
open
fun
remove
(
@IntRange
(
from
=
0
)
position
:
Int
)
{
removeAt
(
position
)
}
/**
* remove the item associated with the specified position of adapter
* 删除指定位置的数据
*
* @param position
*/
open
fun
removeAt
(
@IntRange
(
from
=
0
)
position
:
Int
)
{
if
(
position
>=
data
.
size
)
{
if
(
position
>=
data
.
size
)
{
return
return
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录