Start native apps faster with the Composables CLI ->
Object

ComposeUiFlags

This is a collection of flags which are used to guard against regressions in some of the "riskier" refactors or new feature support that is added to this module.

Source set: Common
public object ComposeUiFlags

This is a collection of flags which are used to guard against regressions in some of the "riskier" refactors or new feature support that is added to this module. These flags are always "on" in the published artifact of this module, however these flags allow end consumers of this module to toggle them "off" in case this new path is causing a regression.

These flags are considered temporary, and there should be no expectation for these flags be around for an extended period of time. If you have a regression that one of these flags fixes, it is strongly encouraged for you to file a bug ASAP.

Usage:

In order to turn a feature off in a debug environment, it is recommended to set this to false 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() { ComposeUiFlags.SomeFeatureEnabled = false 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.ui.ComposeUiFlags { public static int isRectTrackingEnabled return false }

Properties

isViewFocusFixEnabled

Source set: Common
@field:Suppress("MutableBareField") @JvmField public var isViewFocusFixEnabled: Boolean = false

This enables fixes for View focus. The changes are large enough to require a flag to allow disabling them.

isBypassUnfocusableComposeViewEnabled

Source set: Common
public var isBypassUnfocusableComposeViewEnabled: Boolean = true

This flag enables an alternate approach to fixing the issues addressed by the isViewFocusFixEnabled flag.

isInitialFocusOnFocusableAvailable

Source set: Common
public var isInitialFocusOnFocusableAvailable: Boolean = false

Enable initial focus when a focusable is added to a screen with no focusable content.

isFocusRestorationEnabled

Source set: Common
public var isFocusRestorationEnabled: Boolean = false

Enable focus restoration, by always saving focus. This flag depends on isInitialFocusOnFocusableAvailable also being true.

isAccessibilityShouldIncludeOffscreenChildrenEnabled

Source set: Common
public var isAccessibilityShouldIncludeOffscreenChildrenEnabled: Boolean = true

Enables a change where off-screen children of the partially visible merging nodes (e.g. a Text node of a Button) inside scrollable container are now also reported in the semantics tree for Accessibility needs.

Enabled is correct, and it should be enabled in all apps.

isMediaQueryIntegrationEnabled

Source set: Common
public var isMediaQueryIntegrationEnabled: Boolean = false

Enable the integration of LocalUiMediaScope at the root compose view which provides various signals for adapting the UI across different devices.

This feature is experimental and is disabled by default.

isSkipNonImportantSemanticsNodesHitTestEnabled

Source set: Common
public var isSkipNonImportantSemanticsNodesHitTestEnabled: Boolean = true

Enables hit test to continue searching for "semantic nodes" if the initial node that is hit is unimportant from an accessibility semantics node point of view.

isTriggerMoveEventsWhenLocationHasNotChangedEnabled

Source set: Common
public var isTriggerMoveEventsWhenLocationHasNotChangedEnabled: Boolean = false

This flag controls whether the fix for velocity tracker usage in Draggable and related classes is enabled to a) properly track velocity per pointer and b) make sure to also take the pointer events into account that don't move at the beginning of the gesture in order to increase the stability of the computed velocity.

isTrackpadPanHoverFixEnabled

Source set: Common
public var isTrackpadPanHoverFixEnabled: Boolean = true

Fixes trackpad pan gestures (CLASSIFICATIONTWOFINGER_SWIPE).

isTrackpadPinchReinterpretationEnabled

Source set: Common
public var isTrackpadPinchReinterpretationEnabled: Boolean = true

Enables re-interpreting trackpad pinch gestures (CLASSIFICATION_PINCH) as mouse events with scale factor, rather than passing through fake finger touch events.

isMinimalistLocalsEnabled

Source set: Common
public var isMinimalistLocalsEnabled: Boolean = false

Reduce provided CompositionLocals by letting them pull from LocalOwner / LocalAndroidComposeView dynamically when unprovided, instead of eagerly providing all of them.

isVelocityTrackerMinSampleSizeFixEnabled

Source set: Common
public var isVelocityTrackerMinSampleSizeFixEnabled: Boolean = true

Enables calculating velocity from two sample points instead of returning zero. This changes how velocity is calculated for flings, which may affect scrolling, nested scrolling, and similar gesture behaviors. Please file a bug report if disabling this flag resolves the issue.

Note: This flag currently no-ops; the feature will be added in a future change.