androidx.compose.runtime.tooling

Interfaces

CompositionData

A CompositionData is the data tracked by the composer during composition.

Cmn
CompositionGroup

CompositionGroup is a group of data slots tracked independently by composition.

Cmn
CompositionObserver

Observe when the composition begins and ends.

Cmn
CompositionObserverHandle

The handle returned by Composition.observe and RecomposeScope.observe.

Cmn
RecomposeScopeObserver

Observer when a recompose scope is being recomposed or when the scope is disposed.

Cmn

Extension functions summary

Top-level properties summary

ProvidableCompositionLocal<MutableSet<CompositionData>?>

A set of slot tables that where produced when in inspection mode.

Cmn

Extension functions

observe

@ExperimentalComposeRuntimeApi
fun Composition.observe(observer: CompositionObserver): CompositionObserverHandle?

Observe the composition. Calling this twice on the same composition will implicitly dispose the previous observer. the CompositionObserver will be called for this composition and all sub-composition, transitively, for which this composition is a context. If, however, observe is called on a sub-composition, it will override the parent composition and notification for it and all sub-composition of it, will go to its observer instead of the one registered for the parent.

Parameters
observer: CompositionObserver

the observer that will be informed of composition events for this composition and all sub-compositions for which this composition is the composition context. Observing a composition will prevent the parent composition's observer from receiving composition events about this composition.

Returns
CompositionObserverHandle?

a handle that allows the observer to be disposed and detached from the composition. Disposing an observer for a composition with a parent observer will begin sending the events to the parent composition's observer. A null indicates the composition does not support being observed.

observe

@ExperimentalComposeRuntimeApi
fun RecomposeScope.observe(observer: RecomposeScopeObserver): CompositionObserverHandle

Observer when this scope recomposes.

Parameters
observer: RecomposeScopeObserver

the observer that will be informed of recompose events for this scope.

Returns
CompositionObserverHandle

a handle that allows the observer to be disposed and detached from the recompose scope.

Top-level properties

LocalInspectionTables

val LocalInspectionTablesProvidableCompositionLocal<MutableSet<CompositionData>?>

A set of slot tables that where produced when in inspection mode.