SimpleEpoxyAdapter

open class SimpleEpoxyAdapter : EpoxyAdapter

A non-abstract version of com.airbnb.epoxy.EpoxyAdapter that exposes all methods and models as public. Use this if you don't want to create your own adapter subclass and instead want to modify the adapter from elsewhere, such as from an activity.

Functions

addModels
Link copied to clipboard
open fun addModels(modelsToAdd: Array<EpoxyModel<out Any>>)
Adds the models to the end of the models list and notifies that the items wereinserted.
open fun addModels(modelsToAdd: Collection<out EpoxyModel<out Any>>)
Adds the models to the end of the models list and notifies that the items wereinserted.
bindViewHolder
Link copied to clipboard
fun bindViewHolder(holder: VH, position: Int)
createViewHolder
Link copied to clipboard
fun createViewHolder(parent: ViewGroup, viewType: Int): VH
enableDiffing
Link copied to clipboard
open fun enableDiffing()
Enables support for automatically notifying model changes via notifyModelsChanged.If used, this should be called in the constructor, before any models are changed.
getAllModelsAfter
Link copied to clipboard
open fun getAllModelsAfter(model: EpoxyModel<out Any>): List<EpoxyModel<out Any>>
Returns a sub list of all items in models that occur after the given model.
getBoundViewHolders
Link copied to clipboard
open fun getBoundViewHolders(): BoundViewHolders
Returns an object that manages the view holders currently bound to the RecyclerView.
getItemCount
Link copied to clipboard
abstract fun getItemCount(): Int
open fun getItemCount(): Int
getItemId
Link copied to clipboard
open fun getItemId(position: Int): Long
open fun getItemId(position: Int): Long
getItemViewType
Link copied to clipboard
open fun getItemViewType(position: Int): Int
open fun getItemViewType(position: Int): Int
getModelPosition
Link copied to clipboard
open fun getModelPosition(model: EpoxyModel<out Any>): Int
Finds the position of the given model in the list.
getModels
Link copied to clipboard
open fun getModels(): List<EpoxyModel<out Any>>
getSpanCount
Link copied to clipboard
open fun getSpanCount(): Int
getSpanSizeLookup
Link copied to clipboard
open fun getSpanSizeLookup(): GridLayoutManager.SpanSizeLookup
For use with a grid layout manager - use this to get the SpanSizeLookup for models inthis adapter.
hasObservers
Link copied to clipboard
fun hasObservers(): Boolean
hasStableIds
Link copied to clipboard
fun hasStableIds(): Boolean
hideAllAfterModel
Link copied to clipboard
open fun hideAllAfterModel(model: EpoxyModel<out Any>)
Hides all models currently located after the given model in the models list.
hideModel
Link copied to clipboard
open fun hideModel(model: EpoxyModel<out Any>)
Hides the given model, and notifies that the item changed if the item wasn't already hidden.
hideModels
Link copied to clipboard
open fun hideModels(models: Array<EpoxyModel<out Any>>)
Hides the given models, and notifies that each item changed if the item wasn't already hidden.
open fun hideModels(epoxyModels: Iterable<EpoxyModel<out Any>>)
Hides the given models, and notifies that each item changed if the item wasn't already hidden.
insertModelAfter
Link copied to clipboard
open fun insertModelAfter(modelToInsert: EpoxyModel<out Any>, modelToInsertAfter: EpoxyModel<out Any>)
Inserts the given model after the other in the models list, and notifies that the itemwas inserted.
insertModelBefore
Link copied to clipboard
open fun insertModelBefore(modelToInsert: EpoxyModel<out Any>, modelToInsertBefore: EpoxyModel<out Any>)
Inserts the given model before the other in the models list, and notifies that theitem was inserted.
isEmpty
Link copied to clipboard
open fun isEmpty(): Boolean
isMultiSpan
Link copied to clipboard
open fun isMultiSpan(): Boolean
isStickyHeader
Link copied to clipboard
abstract fun isStickyHeader(position: Int): Boolean
open fun isStickyHeader(position: Int): Boolean
Called to check if the item at the position is a sticky item,by default returns false.
notifyDataSetChanged
Link copied to clipboard
fun notifyDataSetChanged()
notifyItemChanged
Link copied to clipboard
fun notifyItemChanged(position: Int)
notifyItemInserted
Link copied to clipboard
fun notifyItemInserted(position: Int)
notifyItemMoved
Link copied to clipboard
fun notifyItemMoved(fromPosition: Int, toPosition: Int)
notifyItemRangeChanged
Link copied to clipboard
fun notifyItemRangeChanged(positionStart: Int, itemCount: Int)
notifyItemRangeInserted
Link copied to clipboard
fun notifyItemRangeInserted(positionStart: Int, itemCount: Int)
notifyItemRangeRemoved
Link copied to clipboard
fun notifyItemRangeRemoved(positionStart: Int, itemCount: Int)
notifyItemRemoved
Link copied to clipboard
fun notifyItemRemoved(position: Int)
notifyModelChanged
Link copied to clipboard
open fun notifyModelChanged(model: EpoxyModel<out Any>)
Notify that the given model has had its data changed.
notifyModelsChanged
Link copied to clipboard
open fun notifyModelsChanged()
Intelligently notify item changes by comparing the current models list against theprevious so you don't have to micromanage notification calls yourself.
onAttachedToRecyclerView
Link copied to clipboard
open fun onAttachedToRecyclerView(recyclerView: RecyclerView)
onBindViewHolder
Link copied to clipboard
abstract fun onBindViewHolder(p: VH, p1: Int)
open fun onBindViewHolder(holder: EpoxyViewHolder, position: Int)
open fun onBindViewHolder(holder: EpoxyViewHolder, position: Int, payloads: List<Any>)
onCreateViewHolder
Link copied to clipboard
abstract fun onCreateViewHolder(p: ViewGroup, p1: Int): VH
open fun onCreateViewHolder(parent: ViewGroup, viewType: Int): EpoxyViewHolder
onDetachedFromRecyclerView
Link copied to clipboard
open fun onDetachedFromRecyclerView(recyclerView: RecyclerView)
open fun onDetachedFromRecyclerView(@NonNull() recyclerView: RecyclerView)
onFailedToRecycleView
Link copied to clipboard
open fun onFailedToRecycleView(holder: VH): Boolean
open fun onFailedToRecycleView(holder: EpoxyViewHolder): Boolean
onRestoreInstanceState
Link copied to clipboard
open fun onRestoreInstanceState(@Nullable() inState: Bundle)
onSaveInstanceState
Link copied to clipboard
open fun onSaveInstanceState(outState: Bundle)
onViewAttachedToWindow
Link copied to clipboard
open fun onViewAttachedToWindow(holder: VH)
open fun onViewAttachedToWindow(holder: EpoxyViewHolder)
onViewDetachedFromWindow
Link copied to clipboard
open fun onViewDetachedFromWindow(holder: VH)
open fun onViewDetachedFromWindow(holder: EpoxyViewHolder)
onViewRecycled
Link copied to clipboard
open fun onViewRecycled(holder: VH)
open fun onViewRecycled(holder: EpoxyViewHolder)
registerAdapterDataObserver
Link copied to clipboard
open fun registerAdapterDataObserver(observer: RecyclerView.AdapterDataObserver)
removeAllAfterModel
Link copied to clipboard
open fun removeAllAfterModel(model: EpoxyModel<out Any>)
Removes all models after the given model, which must have already been added.
removeAllModels
Link copied to clipboard
open fun removeAllModels()
Removes all models
removeModel
Link copied to clipboard
open fun removeModel(model: EpoxyModel<out Any>)
If the given model exists it is removed and an item removal is notified.
setHasStableIds
Link copied to clipboard
open fun setHasStableIds(hasStableIds: Boolean)
setSpanCount
Link copied to clipboard
open fun setSpanCount(spanCount: Int)
If you are using a grid layout manager you must call this to set the span count of the grid.This span count will be passed on to the models so models can choose what span count to be.
setupStickyHeaderView
Link copied to clipboard
open fun setupStickyHeaderView(stickyHeader: View)
open fun setupStickyHeaderView(@NotNull() stickyHeader: View)
Optional callback to setup the sticky view,by default it doesn't do anything.
showModel
Link copied to clipboard
open fun showModel(model: EpoxyModel<out Any>)
Shows the given model, and notifies that the item changed if the item wasn't already shown.
open fun showModel(model: EpoxyModel<out Any>, show: Boolean)
Sets the visibility of the given model, and notifies that the item changed if the newvisibility is different from the previous.
showModels
Link copied to clipboard
open fun showModels(models: Array<EpoxyModel<out Any>>)
Shows the given models, and notifies that each item changed if the item wasn't already shown.
open fun showModels(epoxyModels: Iterable<EpoxyModel<out Any>>)
Shows the given models, and notifies that each item changed if the item wasn't already shown.
open fun showModels(show: Boolean, models: Array<EpoxyModel<out Any>>)
Sets the visibility of the given models, and notifies that the items changed if the newvisibility is different from the previous.
open fun showModels(epoxyModels: Iterable<EpoxyModel<out Any>>, show: Boolean)
Sets the visibility of the given models, and notifies that the items changed if the newvisibility is different from the previous.
teardownStickyHeaderView
Link copied to clipboard
open fun teardownStickyHeaderView(stickyHeader: View)
open fun teardownStickyHeaderView(@NotNull() stickyHeader: View)
Optional callback to perform tear down operation on thesticky view, by default it doesn't do anything.
unregisterAdapterDataObserver
Link copied to clipboard
open fun unregisterAdapterDataObserver(observer: RecyclerView.AdapterDataObserver)