ComposeMaterial3Flags


The object holding the feature flags.

Developers can enable or disable experimental or migration-based features by modifying the boolean values within this object. These flags are considered temporary. They are expected to be removed and should not be relied upon as permanent configuration.

Usage:

class MyApplication : Application() {
override fun onCreate() {
ComposeMaterial3Flags.someFeatureEnabled = true
super.onCreate()
}
}

Summary

Public properties

Boolean

This flag affects Material3 components that use androidx.compose.ui.Modifier.anchoredDraggable.

Cmn
Boolean

This flag affects Material3 components that use androidx.compose.ui.Modifier.anchoredDraggable.

Cmn
Boolean

When the flag is true, the Checkbox will use Material Design 3 styling, including updated colors and container sizing.

Cmn
Boolean

When this flag is true and a precision pointer is present, components are resized accordingly

Cmn
Boolean

When this flag is true, the Snackbar component will use an updated layout implementation that correctly handles vertical alignment for multi-line text.

Cmn
Boolean

When the flag is true, the TextButton will use Material Design 3 paddings and sizings.

Cmn

Public properties

isAnchoredDraggableComponentsInvalidationFixEnabled

var isAnchoredDraggableComponentsInvalidationFixEnabledBoolean

This flag affects Material3 components that use androidx.compose.ui.Modifier.anchoredDraggable. Those are: BottomSheetScaffold, ModalBottomSheet, SwipeToDismissBox and WideNavigationRail.

When this flag is set to true, these components will recalculate their anchor points when the instance of their respective state changes and remeasure. When this flag is set to false, no additional remeasure is performed when the state instance changes.

isAnchoredDraggableComponentsStrictOffsetCheckEnabled

var isAnchoredDraggableComponentsStrictOffsetCheckEnabledBoolean

This flag affects Material3 components that use androidx.compose.ui.Modifier.anchoredDraggable. Those are: BottomSheetScaffold, ModalBottomSheet, SwipeToDismissBox and WideNavigationRail.

When this flag is set to true, these components will require their internal offset to be initialized during measurement before they are placed, throwing an exception if the offset was not initialized in placement. When this flag is set to false, the component will not throw an exception and won't place the content while their internal offset is not initialized. The content will be placed as soon as the offset is initialized.

This flag can be helpful if you are encountering a crash with an uninitialized offset (such as https://issuetracker.google.com/issues/477038695) and will be removed when the associated bugs are fixed.

isCheckboxStylingFixEnabled

var isCheckboxStylingFixEnabledBoolean

When the flag is true, the Checkbox will use Material Design 3 styling, including updated colors and container sizing. When false, it uses older Material Design 2 styling. See the Material Design 2 Checkboxes Specs and the Material Design 3 Checkboxes Specs.

isPrecisionPointerComponentSizingEnabled

var isPrecisionPointerComponentSizingEnabledBoolean

When this flag is true and a precision pointer is present, components are resized accordingly

isSnackbarStylingFixEnabled

var isSnackbarStylingFixEnabledBoolean

When this flag is true, the Snackbar component will use an updated layout implementation that correctly handles vertical alignment for multi-line text.

isTextButtonContentPaddingFixEnabled

var isTextButtonContentPaddingFixEnabledBoolean

When the flag is true, the TextButton will use Material Design 3 paddings and sizings. When false, it uses older Material Design 2 styling. See Material Design 2 Text Buttons Specs and Material Design 3 Text Buttons Specs.