Object

AndroidComposeUiFlags

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: Android
public object AndroidComposeUiFlags

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() { AndroidComposeUiFlags.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.AndroidComposeUiFlags { public static int isSharedComposeViewContextEnabled return false }

Properties

isViewBasedSemanticsHandlerEnabled

Source set: Android
public var isViewBasedSemanticsHandlerEnabled: Boolean = true

This flag enables using the View's handler for semantics processing instead of the Main Looper. This avoids crashes in environments where Compose is used on a non-main thread.

isFrameworkVelocityTrackerEnabled

Source set: Android
public var isFrameworkVelocityTrackerEnabled: Boolean = true

This flag enables the Android Framework implementation of VelocityTracker.

isHardwareNavigationHandlingEnabled

Source set: Android
public var isHardwareNavigationHandlingEnabled: Boolean = false

Guard for Hardware Navigation system default behavior in Compose.

isDelayAndroidViewsHandlerCreationEnabled

Source set: Android
public var isDelayAndroidViewsHandlerCreationEnabled: Boolean = true

If enabled, the creation of the container for AndroidViews is delayed until an AndroidView is added.

isAlwaysScrollDuringScrollCaptureEnabled

Source set: Android
public var isAlwaysScrollDuringScrollCaptureEnabled: Boolean = true

This flag forces scroll capture to center the content being rendered even if it's already visible.

isOutOfFrameSchedulerForTextInputEventsEnabled

Source set: Android
public var isOutOfFrameSchedulerForTextInputEventsEnabled: Boolean = true

Enables using out of frame scheduler instead of Choreographer for text input events.

isSkipRedundantRestartInputOnInitialFocusEnabled

Source set: Android
public var isSkipRedundantRestartInputOnInitialFocusEnabled: Boolean = true

When enabled, focusing a Compose text field in a newly focused ComposeView starts a single input method session instead of restarting the session immediately after creation. This prevents the soft keyboard from dropping early keystrokes typed while the keyboard is opening.

isScrollAccessibilityFocusEventEnabled

Source set: Android
public var isScrollAccessibilityFocusEventEnabled: Boolean = true

With this flag on, a node that gains input focus while it is outside the accessibility tree (for example a lazy list item composed by BeyondBoundsLayout for keyboard navigation) or while it is not visible to the user dispatches TYPEVIEWFOCUSED once it becomes visible, typically after it has been scrolled into the viewport. This lets screen readers follow keyboard focus into items that were off-screen when they were focused.

isShowOnScreenContentPaddingEnabled

Source set: Android
public var isShowOnScreenContentPaddingEnabled: Boolean = true

If enabled, android.R.id.accessibilityActionShowOnScreen accounts for the scrollable container's content padding (such as LazyColumn(contentPadding = ...)) when calculating the scroll delta required to make a target node fully visible.

isNestedScrollInteropViewHolderFixEnabled

Source set: Android
public var isNestedScrollInteropViewHolderFixEnabled: Boolean = true

Enables dispatching nested scroll events from androidx.compose.ui.viewinterop.AndroidView to parent Compose nested scroll connections when the root hosted View has isNestedScrollingEnabled set to false by default (such as FrameLayout or FragmentContainerView wrapping a scrolling child View).

isPointerInteropFilterNodeEnabled

Source set: Android
public var isPointerInteropFilterNodeEnabled: Boolean = true

Whether to use Modifier.Node for androidx.compose.ui.input.pointer.pointerInteropFilter. If false, the legacy Modifier.composed implementation will be used instead.

isNestedScrollInteropMeasureAndLayoutEnabled

Source set: Android
public var isNestedScrollInteropMeasureAndLayoutEnabled: Boolean = true

Enables synchronously flushing pending snapshot notifications and running measure and layout when androidx.compose.ui.viewinterop.AndroidView dispatches nested pre-scroll and post-scroll deltas to parent Compose nested scroll connections, so the child View observes any resulting container window offset synchronously during the nested scroll callback.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: