@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 |
java.lang.Class<?>[] |
events |
boolean |
isPublic |
boolean |
isPureRender |
int |
poolSize |
boolean |
shouldUseDisplayList |
java.lang.Class<?>[] |
triggers |
java.lang.String |
value |
public abstract boolean isPublic
public abstract boolean isPureRender
public abstract boolean canMountIncrementally
public abstract java.lang.Class<?>[] events
public abstract boolean shouldUseDisplayList