-
- All Implemented Interfaces:
-
com.chad.library.adapter4.fullspan.FullSpanAdapterType
public abstract class TrailingLoadStateAdapter<VH extends RecyclerView.ViewHolder> extends LoadStateAdapter<VH>
Tail load more parent class Adapter. 尾部加载更多的父类 Adapter
Custom layout: You can modify the layout by extends this class and customizing RecyclerView.ViewHolder. 自定义布局:可以通过继承此类,并自定义RecyclerView.ViewHolder来修改布局
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTrailingLoadStateAdapter.OnTrailingListener
-
Field Summary
Fields Modifier and Type Field Description private TrailingLoadStateAdapter.OnTrailingListeneronTrailingListenerprivate BooleanisAutoLoadMoreprivate IntegerpreloadSizeprivate final BooleanisLoadEndDisplayprivate LoadStateloadStateprivate final BooleanisLoadingprivate RecyclerViewrecyclerView
-
Constructor Summary
Constructors Constructor Description TrailingLoadStateAdapter(Boolean isLoadEndDisplay)
-
Method Summary
Modifier and Type Method Description final TrailingLoadStateAdapter.OnTrailingListenergetOnTrailingListener()Trailing load state listener events加载更多的监听事件 final UnitsetOnTrailingListener(TrailingLoadStateAdapter.OnTrailingListener onTrailingListener)final BooleangetIsAutoLoadMore()Whether to turn on autoload more. final UnitsetIsAutoLoadMore(Boolean isAutoLoadMore)Whether to turn on autoload more. final IntegergetPreloadSize()Preload, the number of items from the tail. final UnitsetPreloadSize(Integer preloadSize)Preload, the number of items from the tail. final BooleangetIsLoadEndDisplay()Whether to display "Loading end" after all data is loaded. final LoadStategetLoadState()Changing this property will immediately notify the Adapter to change the item it's presenting. final UnitsetLoadState(LoadState loadState)final BooleangetIsLoading()final RecyclerViewgetRecyclerView()final UnitsetRecyclerView(RecyclerView recyclerView)BooleandisplayLoadStateAsItem(LoadState loadState)Returns true if the LoadState should be displayed as a list item when active. UnitonViewAttachedToWindow(VH holder)final UnitinvokeLoadMore()final UnitinvokeFailRetry()final UnitcheckDisableLoadMoreIfNotFullPage()Call this method, Check disable load more if not full page. final <ERROR CLASS>setOnLoadMoreListener(TrailingLoadStateAdapter.OnTrailingListener listener)Set load state listener 设置监听事件 StringtoString()-
Methods inherited from class com.chad.library.adapter4.loadState.trailing.TrailingLoadStateAdapter
addLoadStateListener, getItemCount, getItemViewType, getStateViewType, onAttachedToRecyclerView, onBindViewHolder, onBindViewHolder, onBindViewHolder, onCreateViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, removeLoadStateListener -
Methods inherited from class com.chad.library.adapter4.loadState.LoadStateAdapter
bindViewHolder, canRestoreState, createViewHolder, findRelativeAdapterPositionIn, getItemId, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onFailedToRecycleView, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
TrailingLoadStateAdapter
TrailingLoadStateAdapter(Boolean isLoadEndDisplay)
-
-
Method Detail
-
getOnTrailingListener
final TrailingLoadStateAdapter.OnTrailingListener getOnTrailingListener()
Trailing load state listener events
加载更多的监听事件
-
setOnTrailingListener
final Unit setOnTrailingListener(TrailingLoadStateAdapter.OnTrailingListener onTrailingListener)
-
getIsAutoLoadMore
final Boolean getIsAutoLoadMore()
Whether to turn on autoload more. Called when it must be initialized
是否打开自动加载更多
-
setIsAutoLoadMore
final Unit setIsAutoLoadMore(Boolean isAutoLoadMore)
Whether to turn on autoload more. Called when it must be initialized
是否打开自动加载更多
-
getPreloadSize
final Integer getPreloadSize()
Preload, the number of items from the tail.
预加载,距离尾部 item 的个数
-
setPreloadSize
final Unit setPreloadSize(Integer preloadSize)
Preload, the number of items from the tail.
预加载,距离尾部 item 的个数
-
getIsLoadEndDisplay
final Boolean getIsLoadEndDisplay()
Whether to display "Loading end" after all data is loaded.
所有数据加载完毕后,是否显示"加载结束",必须初始化时传递,中途无法修改参数。
-
getLoadState
final LoadState getLoadState()
Changing this property will immediately notify the Adapter to change the item it's presenting. LoadState.None is the initial state.
要在适配器中显示的 LoadState。更改此属性将立即通知适配器更改 item 的样式。 LoadState.None 为初始状态。
-
setLoadState
final Unit setLoadState(LoadState loadState)
-
getIsLoading
final Boolean getIsLoading()
-
getRecyclerView
final RecyclerView getRecyclerView()
-
setRecyclerView
final Unit setRecyclerView(RecyclerView recyclerView)
-
displayLoadStateAsItem
Boolean displayLoadStateAsItem(LoadState loadState)
Returns true if the LoadState should be displayed as a list item when active.
By default, LoadState.Loading and LoadState.Error present as list items, others do not.
如果 LoadState 在激活时需要显示item,则返回 true。 默认情况下,LoadState.Loading 和 LoadState.Error 将会显示,其他则不显示。
-
onViewAttachedToWindow
@CallSuper() Unit onViewAttachedToWindow(VH holder)
-
invokeLoadMore
final Unit invokeLoadMore()
-
invokeFailRetry
final Unit invokeFailRetry()
-
checkDisableLoadMoreIfNotFullPage
final Unit checkDisableLoadMoreIfNotFullPage()
Call this method, Check disable load more if not full page. 调用此方法,当数据不满足一屏幕的时候,暂停加载更多。应在提交数据 notify 后马上调用。
-
setOnLoadMoreListener
final <ERROR CLASS> setOnLoadMoreListener(TrailingLoadStateAdapter.OnTrailingListener listener)
Set load state listener 设置监听事件
-
-
-
-