@Retention(value=RUNTIME)
public @interface MountSpec
A class that is annotated with MountSpec must implement a method with the
OnCreateMountContent annotation. It may also implement methods with the following
annotations:
- OnLoadStyle
- OnEvent
- OnPrepare
- OnMeasure
- OnBoundsDefined
- OnMount
- OnBind
- OnUnbind
- OnUnmount
If you wish to create a component that is a composition of other components, then use
LayoutSpec instead.
For example:
@MountSpec
public class MyComponentSpec {
@OnCreateMountContent
MyDrawable onCreateMountContent(ComponentContext c) {
return new MyDrawable(c);
}
@OnMount
void onMount(
ComponentContext context,
MyDrawable myDrawable,
@Prop MyProp prop) {
myDrawable.setMyProp(prop);
}
}
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
canMountIncrementally
Whether this mount spec supports incremental mount.
|
java.lang.Class<?>[] |
events
List of event POJOs this component can dispatch.
|
boolean |
isPublic
Whether the generated class should be public.
|
boolean |
isPureRender
Whether the component implements a pure render function.
|
int |
poolSize |
boolean |
shouldUseDisplayList
Whether this drawable mount spec should cache its drawing in a display list.
|
java.lang.String |
value |
public abstract boolean isPublic
public abstract boolean isPureRender
public abstract boolean canMountIncrementally
public abstract java.lang.Class<?>[] events