AsyncEpoxyController

abstract class AsyncEpoxyController : EpoxyController

A subclass of EpoxyController that makes it easy to do model building and diffing in the background.

See https://github.com/airbnb/epoxy/wiki/Epoxy-Controller#asynchronous-support

Constructors

AsyncEpoxyController
Link copied to clipboard
open fun AsyncEpoxyController()
A new instance that does model building and diffing asynchronously.
AsyncEpoxyController
Link copied to clipboard
open fun AsyncEpoxyController(enableAsync: Boolean)
True to do model building and diffing asynchronously, false to do themboth on the main thread.
AsyncEpoxyController
Link copied to clipboard
open fun AsyncEpoxyController(enableAsyncModelBuilding: Boolean, enableAsyncDiffing: Boolean)
Individually control whether model building and diffing are done async or on the main thread.

Functions

add
Link copied to clipboard
open fun add(@NonNull() model: EpoxyModel<out Any>)
Add the model to this controller.
abstract fun add(model: Null)
addInterceptor
Link copied to clipboard
open fun addInterceptor(@NonNull() interceptor: EpoxyController.Interceptor)
Add an interceptor callback to be run after models are built, to make any last changes beforethey are set on the adapter.
addModelBuildListener
Link copied to clipboard
open fun addModelBuildListener(listener: OnModelBuildFinishedListener)
Add a listener that will be called every time buildModels has finished runningand changes have been dispatched to the RecyclerView.
cancelPendingModelBuild
Link copied to clipboard
open fun cancelPendingModelBuild()
Cancels a pending call to buildModels if one has been queued by .
getAdapter
Link copied to clipboard
open fun getAdapter(): EpoxyControllerAdapter
Get the underlying adapter built by this controller.
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 controller.
hasPendingModelBuild
Link copied to clipboard
open fun hasPendingModelBuild(): Boolean
Whether an update to models is currently pending.
isDebugLoggingEnabled
Link copied to clipboard
open fun isDebugLoggingEnabled(): Boolean
isDuplicateFilteringEnabled
Link copied to clipboard
open fun isDuplicateFilteringEnabled(): 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.The sub-classes should override the function if they areusing sticky header feature.
moveModel
Link copied to clipboard
open fun moveModel(fromPosition: Int, toPosition: Int)
An optimized way to move a model from one position to another without rebuilding all models.
notifyModelChanged
Link copied to clipboard
open fun notifyModelChanged(position: Int)
An way to notify the adapter that a model has changed.
onRestoreInstanceState
Link copied to clipboard
open fun onRestoreInstanceState(@Nullable() inState: Bundle)
onSaveInstanceState
Link copied to clipboard
open fun onSaveInstanceState(@NonNull() outState: Bundle)
removeInterceptor
Link copied to clipboard
open fun removeInterceptor(@NonNull() interceptor: EpoxyController.Interceptor)
Remove an interceptor that was added with addInterceptor.
removeModelBuildListener
Link copied to clipboard
open fun removeModelBuildListener(listener: OnModelBuildFinishedListener)
Remove a listener added with addModelBuildListener.
requestDelayedModelBuild
Link copied to clipboard
open fun requestDelayedModelBuild(delayMs: Int)
Call this to request a delayed model update.
requestModelBuild
Link copied to clipboard
open fun requestModelBuild()
Call this to request a model update.
setDebugLoggingEnabled
Link copied to clipboard
open fun setDebugLoggingEnabled(enabled: Boolean)
If enabled, DEBUG logcat messages will be printed to show when models are rebuilt, the timetaken to build them, the time taken to diff them, and the item change outcomes from thediffer.
setFilterDuplicates
Link copied to clipboard
open fun setFilterDuplicates(filterDuplicates: Boolean)
If set to true, Epoxy will search for models with duplicate ids added during and remove any duplicates found.
setGlobalDebugLoggingEnabled
Link copied to clipboard
open fun setGlobalDebugLoggingEnabled(globalDebugLoggingEnabled: Boolean)
Similar to setDebugLoggingEnabled, but this changes the global default forall EpoxyControllers.
setGlobalDuplicateFilteringDefault
Link copied to clipboard
open fun setGlobalDuplicateFilteringDefault(filterDuplicatesByDefault: Boolean)
setFilterDuplicates is disabled in each EpoxyController by default.
setGlobalExceptionHandler
Link copied to clipboard
open fun setGlobalExceptionHandler(@NonNull() globalExceptionHandler: EpoxyController.ExceptionHandler)
Set a callback to be notified when a recoverable exception occurs at runtime.
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 which 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.The sub-classes should override the function if they areusing sticky header feature.
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.The sub-classes should override the function if they areusing sticky header feature.