PrimitiveComponentScope
The implicit receiver for PrimitiveComponent.render call.
Properties
Functions
Creates a binding between the dynamic value, and the content’s property. The default value of the property is assumed to be null, so after unbind, null value will be set to the Content.
Creates a binding between the dynamic value, and the content’s property.
Constructs a new Column without any children.
Constructs a new Column. Add children by using FlexboxContainerScope.child or FlexboxContainerScope.children:
Creates an unique ID for a given component.
Return a android.graphics.drawable.Drawable for a ColorInt value as a Drawable instance.
A utility function to find the View with a given tag under the current Component's LithoView. To set a view tag, use Style.viewTag. An appropriate time to call this is in your Component's onVisible callback.
Retrieves a styled attribute value for provided {@param id}.
Returns the instance registered for the type T in this hierarchy, and null
if no value was registered. Tree props are registered for a sub-hierarchy via TreePropProvider or com.facebook.litho.annotations.OnCreateTreeProp in the Spec API.
Generates an unique id and creates a com.facebook.rendercore.primitives.MountBehavior with it.
Returns the instance registered for the type T in this hierarchy, throws if no value was registered. Tree props are registered for a sub-hierarchy via TreePropProvider or com.facebook.litho.annotations.OnCreateTreeProp in the Spec API.
Constructs a new Column without any children.
Constructs a new Row. Add children by using FlexboxContainerScope.child or FlexboxContainerScope.children:
Creates a DynamicValue with a static initial value. This DynamicValue can be passed to the variants of Style properties that take DynamicValue, like Style.backgroundColor or Style.translationY. You can then imperatively set a new value on the main thread to update that property without a state update, or use the collection of Animated APIs to drive animations on this DynamicValue, which will in turn animate the property.
Creates a DynamicValue deriving from an existing binding param, with modifications applied by transform function.
Create a CachedValue variable within a Component. The calculator will provide the calculated value if it hasn't already been calculated or if the inputs have changed since the previous calculation.
useCallback allows a parent to pass a child component a callback which: 1) maintains referential equality across multiple layout passes 2) is updated to have the latest parent props and state, even if the child doesn't re-render.
1-parameter overload of useCallback: refer to docs there.
2-parameter overload of useCallback: refer to docs there.
3-parameter overload of useCallback: refer to docs there.
4-parameter overload of useCallback: refer to docs there.
5-parameter overload of useCallback: refer to docs there.
6-parameter overload of useCallback: refer to docs there.
7-parameter overload of useCallback: refer to docs there.
Registers a callback to perform side-effects when this Component is attached/detached from the tree.
Registers a callback to perform error handling for exceptions that might happen in child components down in the tree.
Provides a persistent FirstDrawReporter instance to trigger onDrawn callback immediately after the first draw for a given component. To bind returned reporter with a component, pass it via the Style.reportFirstContentDraw prop.
This hook creates a set of references, one for each focusable component that can be used for changing the default focus order. Use with Style.focusOrder
Declares a mutable, main-thread confined reference that will be persisted across renders with an initial value provided by the initializer. It's similar to useState, except that the returned reference is mutable and updating it will not cause a re-render.
Defines one or more Transition animations for the given component
Defines single or multiple Transition animations for the given component.
Defines one or more Transition animations for the given component and allows for the Transition to be re-evaluated based on changes in the deps