MeasuredResultCache

class MeasuredResultCache @JvmOverloads constructor(delegateCache: MeasuredResultCache? = null)

Read & write layout result cache used during render phase for caching measured results that happen during component-measure. This cache can be accessed via components or litho-nodes.

Constructors

Link copied to clipboard
constructor(delegateCache: MeasuredResultCache? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addCachedResult(component: Component, node: LithoNode, layoutResult: LithoLayoutResult)
fun addCachedResult(componentId: Int, node: LithoNode, layoutResult: LithoLayoutResult)

Add a cached result to the cache.

Link copied to clipboard
fun clearCache(component: Component)

Cleares the cache generated for the given component.

fun clearCache(componentId: Int)

Cleares the cache generated for the given component ID.

Link copied to clipboard

Marks this cache as frozen, meaning it is illegal to write new values into it, and should be used as read-only. Attempting to write to a frozen cache will produce an illegal state exception.

Link copied to clipboard

Returns the cached LithoNode from a given component.

fun getCachedNode(componentId: Int): LithoNode?

Returns the cached LithoNode from a given component ID.

Link copied to clipboard

Returns the cached layout result for the given component, or null if it does not exist.

Returns the cached layout result for the given node, or null if it does not exist.

Returns the cached layout result for the given component ID, or null if it does not exist.

Link copied to clipboard

Return true if there exists a cached layout result for the given component.

Return true if there exists a cached layout result for the given LithoNode.

fun hasCachedNode(componentId: Int): Boolean

Return true if there exists a cached layout result for the given component ID.

Link copied to clipboard

Remove the cached layout result for the given Node.