Package com.airbnb.epoxy
Annotation Interface ModelView
An annotation on custom view classes to automatically generate an EpoxyModel for that view. Used
in conjunction with
ModelProp
See https://github.com/airbnb/epoxy/wiki/Generating-Models-from-View-Annotations
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumUse withautoLayout()to declare what layout parameters should be used to size your view when it is added to a RecyclerView. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionIf set to an option besidesModelView.Size.NONEEpoxy will create an instance of this view programmatically at runtime instead of inflating the view from xml.Class<?>An optional EpoxyModel subclass to use as the base class of the generated view.intThe layout file to use in the generated model to inflate the view.booleanTrue to have the generated model take up the total available span count.booleanWhether the model should save view state when unbound.
-
Element Details
-
autoLayout
ModelView.Size autoLayoutIf set to an option besidesModelView.Size.NONEEpoxy will create an instance of this view programmatically at runtime instead of inflating the view from xml. This is an alternative to usingdefaultLayout(), and is a good option if you just need to specify layout parameters on your view with no other styling.The size option you choose will define which layout parameters Epoxy uses at runtime when creating the view.
- Default:
- NONE
-
defaultLayout
@LayoutRes int defaultLayoutThe layout file to use in the generated model to inflate the view. This is required unless a default pattern is set viaPackageModelViewConfigorautoLayout()is used.Overrides any default set in
PackageModelViewConfig- Default:
- 0
-
baseModelClass
Class<?> baseModelClassAn optional EpoxyModel subclass to use as the base class of the generated view. A default can also be set withPackageModelViewConfig* Overrides any default set in
PackageModelViewConfig- Default:
- java.lang.Void.class
-
saveViewState
boolean saveViewStateWhether the model should save view state when unbound.see: EpoxyModel#shouldSaveViewState
- Default:
- false
-
fullSpan
boolean fullSpanTrue to have the generated model take up the total available span count. False to instead use a span count of 1. If you need to programmatically determine your model's span size you can use the spanSizeCallback method on EpoxyModel.- Default:
- true
-