ComposeToolingFlags


This is a collection of flags which are used to enable certain tooling features across Compose libraries. The main difference from androidx.compose.runtime.ComposeRuntimeFlags is that these flags are considered more permanent and are usually disabled unless the tooling feature is required for investigation or other purposes.

Usage:

In order to turn a feature on in a debug environment, it is recommended to set the associated flag to true in as close to the initial loading of the application as possible. Changing this value after compose library code has already been loaded can result in undefined behavior.

class MyApplication : Application() {
    override fun onCreate() {
        ComposeToolingFlags.SomeFeatureEnabled = true
        super.onCreate()
    }
}

In order to turn this off in a release environment, it is recommended to additionally utilize R8 rules which force a single value for the entire build artifact. This can result in the new code paths being completely removed from the artifact, which can often have nontrivial positive performance impact.

-assumevalues class androidx.compose.tooling.ComposeToolingFlags {
    public static int SomeFeatureEnabled return true
}

Summary

Public properties

Boolean

Enables verbose tracing blocks in coroutines launched from @Composable context, measure / layout and other Compose phases.

Cmn

Public properties

isVerboseTracingEnabled

var isVerboseTracingEnabledBoolean

Enables verbose tracing blocks in coroutines launched from @Composable context, measure / layout and other Compose phases. These tracing blocks are intended to accurately measure each phase in macrobenchmarks through Perfetto trace metrics.

The verbose trace blocks might have a negative impact on performance and thus should be disabled by default.