androidx.compose.runtime.tooling
Interfaces
CompositionData |
A |
Cmn
|
CompositionErrorContext |
Provides a way to attach a compose stack trace to a throwable based on a location of compose node in composition. |
Cmn
|
CompositionGroup |
|
Cmn
|
CompositionInstance |
|
Cmn
|
CompositionObserver |
Observe |
Cmn
|
CompositionObserverHandle |
The handle returned by |
Cmn
|
CompositionRegistrationObserver |
Observe when new compositions are added to a recomposer. |
Cmn
|
IdentifiableRecomposeScope |
Interface providing a value to identify a scope for tooling. |
Cmn
|
ObservableComposition |
A composition instance that supports observing lifecycle of its |
Cmn
|
Classes
ComposeStackTraceMode |
Defines how Compose runtime collects stack traces after a crash. |
Cmn
|
LocationSourceInformation |
Source information about composable function call locations inside parent group. |
Cmn
|
ParameterSourceInformation |
Source information about parameters of a function group. |
Cmn
|
SourceInformation |
Source information of a |
Cmn
|
Annotations
Top-level functions summary
SourceInformation? |
Parses source information from a string produced by Compose compiler. |
Cmn
|
Extension functions summary
CompositionInstance? |
Find the |
Cmn
|
CompositionObserverHandle |
Register an observer to be notified when a composition is added to or removed from the given |
Cmn
|
CompositionObserverHandle? |
Observe the composition. |
Cmn
|
Top-level properties summary
CompositionLocal<CompositionErrorContext?> |
Used to attach a compose stack trace to a throwable based on a location of compose node in composition. |
Cmn
|
ProvidableCompositionLocal<MutableSet<CompositionData>?> |
A set of slot tables that where produced when in inspection mode. |
Cmn
|
Top-level functions
parseSourceInformation
@ComposeToolingApi
fun parseSourceInformation(data: String): SourceInformation?
Parses source information from a string produced by Compose compiler. The source information string is usually obtained from CompositionGroup.sourceInfo.
| Returns | |
|---|---|
SourceInformation? |
parsed source information or |
Extension functions
findCompositionInstance
fun CompositionData.findCompositionInstance(): CompositionInstance?
Find the CompositionInstance associated with the root CompositionData. This is only valid for instances of CompositionData that are recorded in a LocalInspectionTables table directly.
Even though CompositionGroups implement the CompositionData interface, only the root CompositionData has an associated CompositionInstance. All CompositionGroup instances will return null.
observe
@ExperimentalComposeRuntimeApi
fun Recomposer.observe(observer: CompositionRegistrationObserver): CompositionObserverHandle
Register an observer to be notified when a composition is added to or removed from the given Recomposer. When this method is called, the observer will be notified of all currently registered compositions per the documentation in CompositionRegistrationObserver.onCompositionRegistered.
| Parameters | |
|---|---|
observer: CompositionRegistrationObserver |
the observer that will be informed of new compositions registered with this |
| Returns | |
|---|---|
CompositionObserverHandle |
a handle that allows the observer to be disposed and detached from the |
setObserver
@ExperimentalComposeRuntimeApi
fun Composition.setObserver(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 setObserver is called on a sub-composition, it will override the parent composition observer for itself and all its sub-compositions.
| 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 |
Top-level properties
LocalCompositionErrorContext
val LocalCompositionErrorContext: CompositionLocal<CompositionErrorContext?>
Used to attach a compose stack trace to a throwable based on a location of compose node in composition. This context is expected to be used by custom node implementations to attach diagnostic compose stack traces to exceptions in passes that are not handled by the Compose runtime (example: measure / layout / draw in Compose UI).
Compose runtime automatically appends information about exceptions that happen in composition and effects.
LocalInspectionTables
val LocalInspectionTables: ProvidableCompositionLocal<MutableSet<CompositionData>?>
A set of slot tables that where produced when in inspection mode.