Package-level declarations

Types

Link copied to clipboard
Annotates a parameter to a component's spec method indicating that it will be supplied as a cached value.
Link copied to clipboard
annotation class Comparable
Annotates a parameter (Prop, TreeProp or State) indicating what kind of equivalence should be used in the "isEquivalentTo" call.
Link copied to clipboard
annotation class Event
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ExcuseMySpec(val reason: Reason)

Spec API usage in Kotlin is deprecated and new Specs will be generally treated as errors. But there are certain cases when Specs in Kotlin should be allowed. This annotation is used to mark such usecases and suppress the linter, an explicit reason is required.

Link copied to clipboard
FromBoundsDefined is used to pass objects from the OnBoundsDefined lifecycle methods of MountSpec to lifecycle methods called successively such as OnMount or OnBind method, use FromBoundsDefined with the same type and name to retrieve your previously set To use it, simply declare a parameter of type com.facebook.litho.Output<> within the method annotated with OnBoundsDefined.
Link copied to clipboard
annotation class FromEvent
Annotates a parameter to a component's event handler callback method indicating that it will be supplied by the event object.
Link copied to clipboard
Annotates that the argument's value should be set to the named inter-stage output from the lifecycle method.
Link copied to clipboard
Link copied to clipboard
FromPrepare is used to pass objects from the OnPrepare lifecycle methods of MountSpec to lifecycle methods called successively such as OnMount or method, use FromPrepare with the same type and name to retrieve your previously set To use it, simply declare a parameter of type com.facebook.litho.Output<> within the method annotated with OnPrepare.
Link copied to clipboard
annotation class FromTrigger
Parameters declared in a class annotated with Event that are used in OnTriggerFor example:
@LayoutSpec
public class ComponentSpec {

 @OnTrigger(YourEvent.class)
  static Object yourEventClick(ComponentContext c,@FromTrigger YourObject obj) {
    return new Object();
  }
}
Link copied to clipboard
annotation class Generated
Link copied to clipboard
Link copied to clipboard
annotation class LayoutSpec
A class that is annotated with this annotation will be used to create a composite component that is made up of other components.
Link copied to clipboard
Link copied to clipboard
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.
Link copied to clipboard
annotation class OnAttached
A method annotated with this annotation is called when the component is attached to the ComponentTree.
Link copied to clipboard
annotation class OnBind
A method annotation used in classes that are annotated with MountSpec.
Link copied to clipboard
EXPERIMENTAL.
Link copied to clipboard
Link copied to clipboard
Annotation for a method on a component's spec that indicates that the method is used to calculate a value that is cached by the component, and may be access in methods using CachedValue.
Link copied to clipboard
This annotation is used in a LayoutSpec; the framework calls the method annotated with OnCreateInitialState before resolving its layout, i.e.
Link copied to clipboard
This annotation is used in conjugation with LayoutSpec.
Link copied to clipboard
OnCreateLayoutWithSizeSpec is the same as OnCreateLayout but the layout can be resolved with a specified width and height.
Link copied to clipboard
The method annotated with this annotation will be called to instantiate the mount content for the MountSpec, when the pool of objects corresponding to this mount content type is empty and recycling is not possible.
Link copied to clipboard
The annotated method will be called to create a custom MountContentPool for this mount spec.
Link copied to clipboard
Annotation for a method that specifies how to animate this component to its new layout and props.
Link copied to clipboard
An annotation for a Spec method that generates tree props.
Link copied to clipboard
annotation class OnDetached
A method annotated with this annotation is called when the component is detached from the ComponentTree.
Link copied to clipboard
Annotated function in the component will allow it be called when entering a working range.
Link copied to clipboard
annotation class OnError
Annotate a method inside your component with @OnError to receive a callback when an exception inside supported delegate methods of a child component happens.
Link copied to clipboard
annotation class OnEvent
Annotation for event handling.
Link copied to clipboard
Annotated function in the component will allow it be called when exiting a working range.
Link copied to clipboard
annotation class OnLoadStyle
Link copied to clipboard
annotation class OnMeasure
A method annotation used in classes that are annotated with MountSpec.
Link copied to clipboard
A method that is annotated with this annotation will be used to compute the baseline of your component.
Link copied to clipboard
annotation class OnMount
A method annotated with OnMount is called on a MountSpec component before the component is attached to a hosting view.
Link copied to clipboard
annotation class OnPrepare
A MountSpec can define a method annotated with OnPrepare to run code that is more heavy and cannot be done during OnMount or OnBind.
Link copied to clipboard
Deprecated: Please avoid using this annotation and it will be not supported in the future release The method annotated with this annotation will be called to register working ranges for the LayoutSpec.
Link copied to clipboard
annotation class OnTrigger
Annotated function in the component will allow its parents to call it with an EventTrigger.
Link copied to clipboard
annotation class OnUnbind
A method annotation used in classes that are annotated with MountSpec.
Link copied to clipboard
annotation class OnUnmount
Link copied to clipboard
Used to mark a method that can update the state of a Component.
Link copied to clipboard
Used to mark a method that can update the state of a Component and trigger Transition returned from this method.
Link copied to clipboard
annotation class Param
Params can be used together with Event callbacks i.e.
Link copied to clipboard
annotation class Prop
Inputs to a Component are its props.
Link copied to clipboard
annotation class PropDefault
PropDefault can be used for setting the default value of an optional Prop in a LayoutSpec or MountSpec.
Link copied to clipboard
annotation class PropSetter
Indicates that a method implementation sets Prop.
Link copied to clipboard
enum Reason : Enum<Reason>
Link copied to clipboard
annotation class RequiredProp
Indicates that a method implementation sets required Prop.
Link copied to clipboard
enum ResType
This enum's constants are used to mark that Prop can receive resources of a corresponding Android resource type as values.
Link copied to clipboard
Annotated function in the component will allow it always be measured when receiving a remeasure event no matter the SizeSpecs are changed or not.
Link copied to clipboard
Annotated function in the component will inform the framework that if this particular instance of the component should be excluded from Incremental Mount.
Link copied to clipboard
annotation class ShouldUpdate
Link copied to clipboard
annotation class State
States for a given Component are the union of all arguments annotated with State in the spec.
Link copied to clipboard
annotation class TestSpec
An interface that is annotated with this annotation will be used to generate a matcher based on the underlying spec.
Link copied to clipboard
annotation class TreeProp
A prop passed silently down from a Spec's parents.