提交 b94b403a 编写于 作者: limuyang2's avatar limuyang2

open `getItem()`

上级 de05bfc2
......@@ -336,7 +336,7 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
}
}
HEADER_VIEW, EMPTY_VIEW, FOOTER_VIEW -> return
else -> convert(holder, data.getOrNull(position - headerLayoutCount))
else -> convert(holder, getItem(position - headerLayoutCount))
}
}
......@@ -356,7 +356,7 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
}
}
HEADER_VIEW, EMPTY_VIEW, FOOTER_VIEW -> return
else -> convert(holder, data.getOrNull(position - headerLayoutCount), payloads)
else -> convert(holder, getItem(position - headerLayoutCount), payloads)
}
}
......@@ -424,7 +424,7 @@ abstract class BaseQuickAdapter<T, VH : BaseViewHolder>
* data set.
* @return The data at the specified position.
*/
fun getItem(@IntRange(from = 0) position: Int): T? {
open fun getItem(@IntRange(from = 0) position: Int): T? {
return data.getOrNull(position)
}
......
......@@ -66,7 +66,7 @@ abstract class BaseSectionQuickAdapter<T : SectionEntity, VH : BaseViewHolder>
override fun onBindViewHolder(holder: VH, position: Int) {
if (holder.itemViewType == SectionEntity.HEADER_TYPE) {
// setFullSpan(holder)
convertHeader(holder, data.getOrNull(position - headerLayoutCount))
convertHeader(holder, getItem(position - headerLayoutCount))
} else {
super.onBindViewHolder(holder, position)
}
......@@ -79,7 +79,7 @@ abstract class BaseSectionQuickAdapter<T : SectionEntity, VH : BaseViewHolder>
}
if (holder.itemViewType == SectionEntity.HEADER_TYPE) {
convertHeader(holder, data.getOrNull(position - headerLayoutCount), payloads)
convertHeader(holder, getItem(position - headerLayoutCount), payloads)
} else {
super.onBindViewHolder(holder, position, payloads)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册