Binding Adapter
open class BindingAdapter : RecyclerView.Adapter<BindingAdapter.BindingViewHolder>
Content copied to clipboard
< Android上最强大的RecyclerView框架 >
一行代码添加多类型 addType
数据模型可以为任何对象 models
通过接口实现来扩展功能 com.drake.brv.item
快速添加触摸事件(防抖点击/快速点击/长按/选择/侧滑/拖拽)
强大的分组/展开/折叠/粘性头部/递归深度/动画/组position expandOrCollapse
自定义列表动画 setAnimation 默认动画 com.drake.brv.animation
头布局/脚布局 addHeader
快速设置分隔物
下拉刷新/上拉加载/自动分页加载 PageRefreshLayout
强大的选择状态 setChecked (切换模式/多选/单选/全选/取消全选/反选/选中数据集/选中数量/单选和多选模式切换)
遵守高内聚低耦合原则, 支持功能配合使用, 代码简洁函数分组
Constructors
BindingAdapter
Link copied to clipboard
fun BindingAdapter()
Content copied to clipboard
Types
Functions
addInterfaceType
Link copied to clipboard
addType
Link copied to clipboard
通过回调函数添加多类型, 一对多多类型(即一个数据类对应多个布局) block中的position为当前item位于列表中的索引, M则为rv的models中对应的数据类型如果泛型为接口类型则自动等效于addInterfaceType
checkedAll
Link copied to clipboard
checkedReverse
Link copied to clipboard
checkedSwitch
Link copied to clipboard
clearFooter
Link copied to clipboard
clearHeader
Link copied to clipboard
expandOrCollapse
Link copied to clipboard
getCheckedModels
Link copied to clipboard
getItemCount
Link copied to clipboard
getItemViewType
Link copied to clipboard
getModelOrNull
Link copied to clipboard
isCheckedAll
Link copied to clipboard
isSameGroup
Link copied to clipboard
onAttachedToRecyclerView
Link copied to clipboard
onBind
Link copied to clipboard
onBindViewHolder
Link copied to clipboard
open override fun onBindViewHolder(holder: BindingAdapter.BindingViewHolder, position: Int)
Content copied to clipboard
open override fun onBindViewHolder(holder: BindingAdapter.BindingViewHolder, position: Int, payloads: MutableList<Any>)
Content copied to clipboard
onClick
Link copied to clipboard
onCreate
Link copied to clipboard
fun onCreate(block: BindingAdapter.BindingViewHolder.(viewType: Int) -> Unit)
Content copied to clipboard
onCreateViewHolder执行时回调
onCreateViewHolder
Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BindingAdapter.BindingViewHolder
Content copied to clipboard
onExpand
Link copied to clipboard
onFastClick
Link copied to clipboard
fun Int.onFastClick(listener: BindingAdapter.BindingViewHolder.(viewId: Int) -> Unit)
Content copied to clipboard
fun onFastClick(@IdRes() vararg id: Int, block: BindingAdapter.BindingViewHolder.(viewId: Int) -> Unit)
Content copied to clipboard
onLongClick
Link copied to clipboard
fun Int.onLongClick(listener: BindingAdapter.BindingViewHolder.(viewId: Int) -> Unit)
Content copied to clipboard
fun onLongClick(@IdRes() vararg id: Int, block: BindingAdapter.BindingViewHolder.(viewId: Int) -> Unit)
Content copied to clipboard
onPayload
Link copied to clipboard
fun onPayload(block: BindingAdapter.BindingViewHolder.(payloads: MutableList<Any>) -> Unit)
Content copied to clipboard
onViewAttachedToWindow
Link copied to clipboard
open override fun onViewAttachedToWindow(holder: BindingAdapter.BindingViewHolder)
Content copied to clipboard
onViewDetachedFromWindow
Link copied to clipboard
open override fun onViewDetachedFromWindow(holder: BindingAdapter.BindingViewHolder)
Content copied to clipboard
removeFooter
Link copied to clipboard
removeFooterAt
Link copied to clipboard
fun removeFooterAt(@IntRange(from = -1.toLong() ) index: Int = -1, animation: Boolean = false)
Content copied to clipboard
removeHeader
Link copied to clipboard
removeHeaderAt
Link copied to clipboard
fun removeHeaderAt(@IntRange(from = 0.toLong() ) index: Int = 0, animation: Boolean = false)
Content copied to clipboard
setAnimation
Link copied to clipboard
setCheckableType
Link copied to clipboard
setChecked
Link copied to clipboard
fun setChecked(@IntRange(from = 0.toLong() ) position: Int, checked: Boolean)
Content copied to clipboard
setDifferModels
Link copied to clipboard
fun setDifferModels(newModels: List<Any?>?, detectMoves: Boolean = true, commitCallback: Runnable? = null)
Content copied to clipboard
toModelPosition
Link copied to clipboard
Properties
_data
Link copied to clipboard
animationEnabled
Link copied to clipboard
animationRepeat
Link copied to clipboard
checkedCount
Link copied to clipboard
checkedPosition
Link copied to clipboard
clickThrottle
Link copied to clipboard
expandAnimationEnabled
Link copied to clipboard
footerCount
Link copied to clipboard
headerCount
Link copied to clipboard
hoverEnabled
Link copied to clipboard
interfacePool
Link copied to clipboard
itemDifferCallback
Link copied to clipboard
itemTouchHelper
Link copied to clipboard
自定义ItemTouchHelper即可设置该属性 等效于RecyclerView.addItemDecoration设置
modelCount
Link copied to clipboard
modelId
Link copied to clipboard
mutable
Link copied to clipboard
onBindViewHolders
Link copied to clipboard
onHoverAttachListener
Link copied to clipboard
rv
Link copied to clipboard
singleExpandMode
Link copied to clipboard
singleMode
Link copied to clipboard
toggleMode
Link copied to clipboard