-
- All Implemented Interfaces:
-
com.chad.library.adapter.base.fullspan.FullSpanAdapterType
public abstract class LeadingLoadStateAdapter<VH extends RecyclerView.ViewHolder> extends LoadStateAdapter<VH>
Leading load state adapter 首部的加载状态适配器
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceLeadingLoadStateAdapter.OnLeadingListener
-
Field Summary
Fields Modifier and Type Field Description private LeadingLoadStateAdapter.OnLeadingListeneronLeadingListenerprivate BooleanisLoadEnableprivate IntegerpreloadSizeprivate LoadStateloadStateprivate final BooleanisLoadingprivate RecyclerViewrecyclerView
-
Constructor Summary
Constructors Constructor Description LeadingLoadStateAdapter()
-
Method Summary
Modifier and Type Method Description final LeadingLoadStateAdapter.OnLeadingListenergetOnLeadingListener()A listener for loading more. final UnitsetOnLeadingListener(LeadingLoadStateAdapter.OnLeadingListener onLeadingListener)final BooleangetIsLoadEnable()Whether enable loading. final UnitsetIsLoadEnable(Boolean isLoadEnable)Whether enable loading. final IntegergetPreloadSize()Preload, the number of distances from the first item. final UnitsetPreloadSize(Integer preloadSize)Preload, the number of distances from the first item. 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 UnitinvokeLoad()final <ERROR CLASS>setOnLeadingListener(LeadingLoadStateAdapter.OnLeadingListener listener)StringtoString()-
Methods inherited from class com.chad.library.adapter.base.loadState.leading.LeadingLoadStateAdapter
addLoadStateListener, getItemCount, getItemViewType, getStateViewType, onAttachedToRecyclerView, onBindViewHolder, onBindViewHolder, onBindViewHolder, onCreateViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, removeLoadStateListener -
Methods inherited from class com.chad.library.adapter.base.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
-
-
Method Detail
-
getOnLeadingListener
final LeadingLoadStateAdapter.OnLeadingListener getOnLeadingListener()
A listener for loading more. 加载更多的监听事件
-
setOnLeadingListener
final Unit setOnLeadingListener(LeadingLoadStateAdapter.OnLeadingListener onLeadingListener)
-
getIsLoadEnable
final Boolean getIsLoadEnable()
Whether enable loading. 是否开启加载功能
-
setIsLoadEnable
final Unit setIsLoadEnable(Boolean isLoadEnable)
Whether enable loading. 是否开启加载功能
-
getPreloadSize
final Integer getPreloadSize()
Preload, the number of distances from the first item.
预加载,距离首 item 的个数
-
setPreloadSize
final Unit setPreloadSize(Integer preloadSize)
Preload, the number of distances from the first item.
预加载,距离首 item 的个数
-
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)
-
invokeLoad
final Unit invokeLoad()
-
setOnLeadingListener
final <ERROR CLASS> setOnLeadingListener(LeadingLoadStateAdapter.OnLeadingListener listener)
-
-
-
-