abstract class Typed3EpoxyController<T : Any!, U : Any!, V : Any!> : EpoxyController
This is a wrapper around com.airbnb.epoxy.EpoxyController to simplify how data is accessed. Use this if the data required to build your models is represented by three objects.
To use this, create a subclass typed with your data object. Then, call #setData whenever that data changes. This class will handle calling #buildModels with the latest data.
You should NOT call #requestModelBuild() directly.
See Also
TypedEpoxyControllerTyped2EpoxyControllerTyped4EpoxyController
Typed3EpoxyController()Typed3EpoxyController(modelBuildingHandler: Handler!, diffingHandler: Handler!) |
static var defaultDiffingHandler: Handler! |
|
static var defaultModelBuildingHandler: Handler! |
fun buildModels(): Unitabstract fun buildModels(data1: T, data2: U, data3: V): Unit |
|
open fun moveModel(fromPosition: Int, toPosition: Int): Unit |
|
open fun requestDelayedModelBuild(delayMs: Int): Unit |
|
fun requestModelBuild(): Unit |
|
open fun setData(data1: T, data2: U, data3: V): Unit
Call this with the latest data when you want models to be rebuilt. The data will be passed on to |
open fun add(model: EpoxyModel<*>): Unit
Add the model to this controller. Can only be called from inside open fun add(vararg modelsToAdd: EpoxyModel<*>!): Unitopen fun add(modelsToAdd: MutableList<out EpoxyModel<*>!>): Unit
Add the models to this controller. Can only be called from inside |
|
open fun addInterceptor(interceptor: EpoxyController.Interceptor): Unit
Add an interceptor callback to be run after models are built, to make any last changes before they are set on the adapter. Interceptors are run in the order they are added. |
|
open fun addModelBuildListener(listener: OnModelBuildFinishedListener!): Unit
Add a listener that will be called every time |
|
open fun cancelPendingModelBuild(): Unit
Cancels a pending call to |
|
open fun getAdapter(): EpoxyControllerAdapter
Get the underlying adapter built by this controller. Use this to get the adapter to set on a RecyclerView, or to get information about models currently in use. |
|
open fun getModelCountBuiltSoFar(): Int
Get the number of models added so far during the |
|
open fun getSpanCount(): Int |
|
open fun getSpanSizeLookup(): SpanSizeLookup
For use with a grid layout manager - use this to get the |
|
open fun hasPendingModelBuild(): Boolean
Whether an update to models is currently pending. This can either be because |
|
open fun isBuildingModels(): Boolean
True if the current callstack originated from the buildModels call, on the same thread. |
|
open fun isDebugLoggingEnabled(): Boolean |
|
open fun isDuplicateFilteringEnabled(): Boolean |
|
open fun isMultiSpan(): 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 are using sticky header feature. |
|
open fun notifyModelChanged(position: Int): Unit
An way to notify the adapter that a model has changed. This is intended to be used with |
|
open fun onAttachedToRecyclerView(recyclerView: RecyclerView): Unit
Called when the controller's adapter is attach to a recyclerview. |
|
open fun onDetachedFromRecyclerView(recyclerView: RecyclerView): Unit
Called when the controller's adapter is detached from a recyclerview. |
|
open fun onExceptionSwallowed(exception: RuntimeException): Unit
This is called when recoverable exceptions occur at runtime. By default they are ignored and Epoxy will recover, but you can override this to be aware of when they happen. |
|
open fun onModelBound(holder: EpoxyViewHolder, boundModel: EpoxyModel<*>, position: Int, previouslyBoundModel: EpoxyModel<*>?): Unit
Called immediately after a model is bound to a view holder. Subclasses can override this if they want alerts on when a model is bound. Alternatively you may attach a listener directly to a generated model with model.onBind(...) |
|
open fun onModelUnbound(holder: EpoxyViewHolder, model: EpoxyModel<*>): Unit
Called immediately after a model is unbound from a view holder. Subclasses can override this if they want alerts on when a model is unbound. Alternatively you may attach a listener directly to a generated model with model.onUnbind(...) |
|
open fun onRestoreInstanceState(inState: Bundle?): Unit |
|
open fun onSaveInstanceState(outState: Bundle): Unit |
|
open fun onViewAttachedToWindow(holder: EpoxyViewHolder, model: EpoxyModel<*>): Unit
Called when the given viewholder is attached to the window, along with the model it is bound to. |
|
open fun onViewDetachedFromWindow(holder: EpoxyViewHolder, model: EpoxyModel<*>): Unit
Called when the given viewholder is detechaed from the window, along with the model it is bound to. |
|
open fun removeInterceptor(interceptor: EpoxyController.Interceptor): Unit
Remove an interceptor that was added with |
|
open fun removeModelBuildListener(listener: OnModelBuildFinishedListener!): Unit
Remove a listener added with |
|
open fun setDebugLoggingEnabled(enabled: Boolean): Unit
If enabled, DEBUG logcat messages will be printed to show when models are rebuilt, the time taken to build them, the time taken to diff them, and the item change outcomes from the differ. The tag of the logcat message is the class name of your EpoxyController. |
|
open fun setFilterDuplicates(filterDuplicates: Boolean): Unit
If set to true, Epoxy will search for models with duplicate ids added during |
|
open static fun setGlobalDebugLoggingEnabled(globalDebugLoggingEnabled: Boolean): Unit
Similar to |
|
open static fun setGlobalDuplicateFilteringDefault(filterDuplicatesByDefault: Boolean): Unit
|
|
open static fun setGlobalExceptionHandler(globalExceptionHandler: EpoxyController.ExceptionHandler): Unit
Set a callback to be notified when a recoverable exception occurs at runtime. By default these are ignored and Epoxy will recover, but you can override this to be aware of when they happen. |
|
open fun setSpanCount(spanCount: Int): Unit
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. |
|
open fun setupStickyHeaderView(stickyHeader: View): Unit
Optional callback to setup the sticky view, by default it doesn't do anything. The sub-classes should override the function if they are using sticky header feature. |
|
open fun teardownStickyHeaderView(stickyHeader: View): Unit
Optional callback to perform tear down operation on the sticky view, by default it doesn't do anything. The sub-classes should override the function if they are using sticky header feature. |