ComponentContext

open class ComponentContext

A Context subclass for use within the Components framework. Contains extra bookkeeping information used internally in the library.

Constructors

Link copied to clipboard
constructor(context: Context)
This constructors takes a Context.
constructor(context: Context, @Nullable lithoConfiguration: LithoConfiguration, @Nullable treePropContainer: TreePropContainer)
constructor(context: ComponentContext)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun calculateLayoutOutputId(componentKey: String, type: Int): Long
Calculates a returns a unique ID for a given component key and output type.
Link copied to clipboard
inline fun ComponentContext.dimenRes(@DimenRes id: Int): Dimen

Resolve a dimen resource ID as a Dimen value.

Link copied to clipboard
open fun <T : View?> findViewWithTag(tag: Any): T
A utility function to find the View with a given tag under the current Component's LithoView.
Link copied to clipboard
open fun findViewWithTagValue(key: Int, tag: Any): View
A utility function to find the View with a given tag under the current Component's LithoView.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getCachedValue(globalKey: String, index: Int, cachedValueInputs: Any): Any
Link copied to clipboard
open fun getColor(@ColorRes id: Int): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getGlobalKey(): String
Link copied to clipboard
open fun getLayoutVersion(): Int
Link copied to clipboard
Link copied to clipboard
open fun getLogger(): ComponentsLogger
Link copied to clipboard
Link copied to clipboard
open fun <T> getParentTreeProp(key: Class<T>): T
Link copied to clipboard
open fun getResourceCache(): ResourceCache
Link copied to clipboard
open fun getResourceResolver(): ResourceResolver
Link copied to clipboard
Link copied to clipboard
open fun getString(@StringRes resId: Int): String
open fun getString(@StringRes resId: Int, formatArgs: Array<Any>): String
Link copied to clipboard
open fun getText(@StringRes resId: Int): CharSequence
Link copied to clipboard
open fun <T> getTreeProp(key: Class<T>): T
Link copied to clipboard
Obtain a copy of the tree props currently held by this context.
Link copied to clipboard
Checks if incremental mount is enabled given a ComponentContext, so you can throw an error if you require that incremental mount is enabled (e.g.
Link copied to clipboard
Creates a new ComponentContext based on the given ComponentContext, propagating log tag, logger, and tree props.
Link copied to clipboard
open fun obtainStyledAttributes(attrs: Array<Int>, @AttrRes defStyleAttr: Int): TypedArray
Link copied to clipboard
open fun putCachedValue(globalKey: String, index: Int, cachedValueInputs: Any, @Nullable cachedValue: Any)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun updateStateAsync(stateUpdate: StateContainer.StateUpdate, attribution: String)
Notify the Component Tree that it needs to asynchronously perform a state update.
Link copied to clipboard
Link copied to clipboard
open fun updateStateSync(stateUpdate: StateContainer.StateUpdate, attribution: String)
Notify the Component Tree that it needs to synchronously perform a state update.
Link copied to clipboard
open fun updateStateWithTransition(stateUpdate: StateContainer.StateUpdate, attribution: String)