Page Refresh Layout
open class PageRefreshLayout : SmartRefreshLayout, OnRefreshLoadMoreListener
Content copied to clipboard
扩展SmartRefreshLayout的功能
功能
下拉刷新
上拉加载
拉取
预加载
预拉取
自动分页
添加数据
缺省状态页
Constructors
Types
Functions
addData
Link copied to clipboard
fun addData(data: List<Any?>?, adapter: BindingAdapter? = null, isEmpty: () -> Boolean = { data.isNullOrEmpty() }, hasMore: BindingAdapter.() -> Boolean = { true })
Content copied to clipboard
自动分页自动加载数据, 自动判断当前属于下拉刷新还是上拉加载更多
实现
当getState等于RefreshState.Refreshing或者index等于startIndex会判断为下拉刷新 index初始值为startIndex, 每次调用本方法会将index递增, 下拉刷新会将index重置为startIndex注意事项
请勿每次给data赋值同一个集合对象, 因为为了保证rv持有数据集合为一个对象, 覆盖数据会先clear再addAll新的数据集合本方法只是简化分页列表数据赋值, 如果出现特别的需求请尝试自己更新rv数据集(即不使用本方法), 比如使用BindingAdapter.modelsfinishLoadMore
Link copied to clipboard
open override fun finishLoadMore(delayed: Int, success: Boolean, noMoreData: Boolean): RefreshLayout
Content copied to clipboard
finishRefresh
Link copied to clipboard
open override fun finishRefresh(delayed: Int, success: Boolean, noMoreData: Boolean?): RefreshLayout
Content copied to clipboard
onContent
Link copied to clipboard
onLoadMore
Link copied to clipboard
onRefresh
Link copied to clipboard
refreshing
Link copied to clipboard
setEnableLoadMore
Link copied to clipboard
setEnableRefresh
Link copied to clipboard
setOnMultiStateListener
Link copied to clipboard
fun setOnMultiStateListener(onMultiStateListener: OnMultiStateListener): PageRefreshLayout
Content copied to clipboard
setRetryIds
Link copied to clipboard
showContent
Link copied to clipboard
showLoading
Link copied to clipboard
Properties
emptyLayout
Link copied to clipboard
errorLayout
Link copied to clipboard
loadingLayout
Link copied to clipboard
onBindViewHolderListener
Link copied to clipboard
preloadIndex
Link copied to clipboard
recyclerViewId
Link copied to clipboard
refreshEnableWhenEmpty
Link copied to clipboard
refreshEnableWhenError
Link copied to clipboard
rv
Link copied to clipboard
stateChangedHandler
Link copied to clipboard
stateEnabled
Link copied to clipboard
stateLayout
Link copied to clipboard
stateLayoutId
Link copied to clipboard
upFetchEnabled
Link copied to clipboard