MountSpec

Deprecated

A class that is annotated with this annotation will be used to create a component that renders something, in the form of either a Drawable or a View.

A class that is annotated with MountSpec must implement a method with the annotation. It may also implement methods with the following annotations:

If you wish to create a component that is a composition of other components, then use instead.

For example:

@MountSpec
public class MyComponentSpec {

 @OnCreateMountContent
  MyDrawable onCreateMountContent(Context context) {
    return new MyDrawable(context);
  }

 @OnMount
  void onMount(
      ComponentContext c,
      MyDrawable myDrawable,
     @Prop MyProp prop) {
    myDrawable.setMyProp(prop);
  }
}

Deprecated

Use com.facebook.litho.PrimitiveComponents for new bridged components instead of MountSpecs. Specs should only be used in Java.

For detailed information read PrimitiveComponents docs.

For migration guide from MountSpecs to PrimitiveComponents read this: Migrating MountSpecs doc.

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun canPreallocate(): Boolean
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun events(): Array<Class<out Any>>
Link copied to clipboard
abstract fun hasChildLithoViews(): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun isPublic(): Boolean
Link copied to clipboard
abstract fun isPureRender(): Boolean
Link copied to clipboard
abstract fun poolSize(): Int
Link copied to clipboard
abstract fun toString(): String
Link copied to clipboard
abstract fun triggers(): Array<Class<out Any>>
Link copied to clipboard
abstract fun value(): String
Class name of the generated component.