# AndroidComposeUiFlags

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/AndroidComposeUiFlags.android.kt+class:androidx.compose.ui.AndroidComposeUiFlags) Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0) Common/AllAndroid/JVM
- android

  ```
  @ExperimentalComposeUiApi
  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.

```kotlin
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.

```kotlin
-assumevalues class androidx.compose.ui.AndroidComposeUiFlags {
    public static int isSharedComposeViewContextEnabled return false
}
```

## Summary

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isAccessibilityPerformanceEnabled()` This flag enables performance improvements in accessibility, such as caching accessibility state and deferring listener registration. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isAlwaysScrollDuringScrollCaptureEnabled()` This flag forces scroll capture to center the content being rendered even if it's already visible. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isDelayAndroidViewsHandlerCreationEnabled()` If enabled, the creation of the container for AndroidViews is delayed until an AndroidView is added. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isDelayedWindowInsetsRulersEnabled()` If enabled, WindowInsetsRulers interactions will use the delayed-initialization path to improve ComposeView startup time. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isFrameworkVelocityTrackerEnabled()` This flag enables the Android Framework implementation of VelocityTracker. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isOutOfFrameSchedulerForTextInputEventsEnabled()` Enables using out of frame scheduler instead of Choreographer for text input events. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isPropagateHideFromAccessibilityToMergingChildrenEnabled()` Enables propagation of hideFromAccessibility to children of merging parents. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isScrollAccessibilityFocusEventEnabled()` This flag enables dispatching accessibility focus events (TYPE_VIEW_ACCESSIBILITY_FOCUSED) after keyboard scroll events for screen-reader synchronization. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isTraversalGroupSortingEnabled()` Enables sorting of accessibility children based on their traversal index when the parent is a traversal group and is a merging container. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/AndroidComposeUiFlags#isViewBasedSemanticsHandlerEnabled()` This flag enables using the View's handler for semantics processing instead of the Main Looper. | android |

## Public properties

### isAccessibilityPerformanceEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isAccessibilityPerformanceEnabled: Boolean
```

This flag enables performance improvements in accessibility, such as caching accessibility state and deferring listener registration.

### isAlwaysScrollDuringScrollCaptureEnabled

android Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
var isAlwaysScrollDuringScrollCaptureEnabled: Boolean
```

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

### isDelayAndroidViewsHandlerCreationEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isDelayAndroidViewsHandlerCreationEnabled: Boolean
```

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

### isDelayedWindowInsetsRulersEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isDelayedWindowInsetsRulersEnabled: Boolean
```

If enabled, WindowInsetsRulers interactions will use the delayed-initialization path to improve ComposeView startup time. If disabled, the immediate-initialization path is used instead.

### isFrameworkVelocityTrackerEnabled

android Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
var isFrameworkVelocityTrackerEnabled: Boolean
```

This flag enables the Android Framework implementation of VelocityTracker.

### isOutOfFrameSchedulerForTextInputEventsEnabled

android Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.12.0)

```
var isOutOfFrameSchedulerForTextInputEventsEnabled: Boolean
```

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

### isPropagateHideFromAccessibilityToMergingChildrenEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isPropagateHideFromAccessibilityToMergingChildrenEnabled: Boolean
```

Enables propagation of hideFromAccessibility to children of merging parents.

### isScrollAccessibilityFocusEventEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isScrollAccessibilityFocusEventEnabled: Boolean
```

This flag enables dispatching accessibility focus events (TYPE_VIEW_ACCESSIBILITY_FOCUSED) after keyboard scroll events for screen-reader synchronization.

### isTraversalGroupSortingEnabled

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
var isTraversalGroupSortingEnabled: Boolean
```

Enables sorting of accessibility children based on their traversal index when the parent is a traversal group and is a merging container.

### isViewBasedSemanticsHandlerEnabled

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
var isViewBasedSemanticsHandlerEnabled: Boolean
```

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.