abstract class EpoxyModelWithHolder<T : EpoxyHolder!> : EpoxyModel<T>
A version of com.airbnb.epoxy.EpoxyModel that allows you to use a view holder pattern instead of a specific view when binding to your model.
EpoxyModelWithHolder()EpoxyModelWithHolder(id: Long) |
open fun bind(holder: T): Unitopen fun bind(holder: T, payloads: MutableList<Any!>): Unitopen fun bind(holder: T, previouslyBoundModel: EpoxyModel<*>): Unit |
|
abstract fun createNewHolder(parent: ViewParent): T
This should return a new instance of your |
|
open fun onFailedToRecycleView(holder: T): Boolean |
|
open fun onViewAttachedToWindow(holder: T): Unit |
|
open fun onViewDetachedFromWindow(holder: T): Unit |
|
open fun onVisibilityChanged(percentVisibleHeight: Float, percentVisibleWidth: Float, visibleHeight: Int, visibleWidth: Int, holder: T): Unit |
|
open fun onVisibilityStateChanged(visibilityState: Int, holder: T): Unit |
|
open fun unbind(holder: T): Unit |
open fun addIf(condition: Boolean, controller: EpoxyController): Unit
Add this model to the given controller if the condition is true. Can only be called from inside open fun addIf(predicate: EpoxyModel.AddPredicate, controller: EpoxyController): Unit
Add this model to the given controller if the |
|
open fun addTo(controller: EpoxyController): Unit
Add this model to the given controller. Can only be called from inside |
|
fun addWithDebugValidation(controller: EpoxyController): Unit
This is used internally by generated models to turn on validation checking when "validateEpoxyModelUsage" is enabled and the model is used with an |
|
open fun buildView(parent: ViewGroup): View!
Create and return a new instance of a view for this model. By default a view is created by inflating the layout resource. |
|
open fun equals(other: Any?): Boolean |
|
abstract fun getDefaultLayout(): Int
Return the default layout resource to be used when creating views for this model. The resource will be inflated to create a view for the model; additionally the layout int is used as the views type in the RecyclerView. |
|
fun getLayout(): Int |
|
open fun getSpanSize(totalSpanCount: Int, position: Int, itemCount: Int): Int
Subclasses can override this if they want their view to take up more than one span in a grid layout. |
|
open fun getViewType(): Int
Get the view type to associate with this model in the recyclerview. For models that use a layout resource, the view type is simply the layout resource value by default. |
|
open fun hashCode(): Int |
|
open fun hide(): EpoxyModel<T>
Change the visibility of the model so that it's view is hidden. This only works if the model is used in |
|
open fun id(): Longopen fun id(id: Long): EpoxyModel<T>!
Override the default id in cases where the data subject naturally has an id, like an object from a database. This id can only be set before the model is added to the adapter, it is an error to change the id after that. open fun id(vararg ids: Number!): EpoxyModel<T>!
Use multiple numbers as the id for this model. Useful when you don't have a single long that represents a unique id. open fun id(id1: Long, id2: Long): EpoxyModel<T>!
Use two numbers as the id for this model. Useful when you don't have a single long that represents a unique id. open fun id(key: CharSequence?): EpoxyModel<T>!
Use a string as the model id. Useful for models that don't clearly map to a numerical id. This is preferable to using open fun id(key: CharSequence?, vararg otherKeys: CharSequence!): EpoxyModel<T>!
Use several strings to define the id of the model. open fun id(key: CharSequence?, id: Long): EpoxyModel<T>!
Set an id that is namespaced with a string. This is useful when you need to show models of multiple types, side by side and don't want to risk id collisions. |
|
open fun isShown(): Boolean
Whether the model's view should be shown on screen. If false it won't be inflated and drawn, and will be like it was never added to the recycler view. |
|
open fun layout(layoutRes: Int): EpoxyModel<T> |
|
fun onMutation(): Unit
This is used internally by generated models to do validation checking when "validateEpoxyModelUsage" is enabled and the model is used with an |
|
open fun reset(): EpoxyModel<T>
Sets fields of the model to default ones. |
|
open fun shouldSaveViewState(): Boolean
Whether the adapter should save the state of the view bound to this model. |
|
open fun show(): EpoxyModel<T>
Change the visibility of the model so that it's view is shown. This only works if the model is used in open fun show(show: Boolean): EpoxyModel<T>
Change the visibility of the model's view. This only works if the model is used in |
|
fun spanSize(totalSpanCount: Int, position: Int, itemCount: Int): Int
Returns the actual span size of this model, using the |
|
open fun spanSizeOverride(spanSizeCallback: EpoxyModel.SpanSizeOverrideCallback?): EpoxyModel<T>! |
|
open fun toString(): String |
|
fun validateStateHasNotChangedSinceAdded(descriptionOfChange: String!, modelPosition: Int): Unit
This is used internally by generated models to do validation checking when "validateEpoxyModelUsage" is enabled and the model is used with a |
open class EpoxyModelGroup : EpoxyModelWithHolder<ModelGroupHolder!>
An |