public object 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()
}
}
Properties
isCheckboxStylingFixEnabled
public var isCheckboxStylingFixEnabled: Boolean = false
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.
isSnackbarStylingFixEnabled
public var isSnackbarStylingFixEnabled: Boolean = false
When this flag is true, the Snackbar component will use an updated layout implementation that correctly handles vertical alignment for multi-line text.
isPrecisionPointerComponentSizingEnabled
public var isPrecisionPointerComponentSizingEnabled: Boolean = false
When this flag is true and a precision pointer is present, components are resized accordingly
isAnchoredDraggableComponentsStrictOffsetCheckEnabled
public var isAnchoredDraggableComponentsStrictOffsetCheckEnabled: Boolean = true
This flag affects Material3 components that use androidx.compose.foundation.gestures.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.
isAnchoredDraggableComponentsInvalidationFixEnabled
public var isAnchoredDraggableComponentsInvalidationFixEnabled: Boolean = true
This flag affects Material3 components that use androidx.compose.foundation.gestures.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.
isBottomSheetPartiallyExpandedDeterministicEnabled
public var isBottomSheetPartiallyExpandedDeterministicEnabled: Boolean = true
This flag affects BottomSheet and ModalBottomSheet.
When true (default), BottomSheet will always include SheetValue.PartiallyExpanded if provided in SheetState.enabledValues, converging it with SheetValue.Expanded for small sheets.
When false, the legacy auto-exclusion logic is enabled.
isUpdatedTimepickerToggleEnabled
public var isUpdatedTimepickerToggleEnabled: Boolean = true
This flag affects TimePicker.
When true (default), TimePicker AM/PM toggle buttons will use shape morph buttons and bold the text of the selected button.
When false, the legacy AM/PM toggle items are displayed.
isExpressiveListItemHeightBasedOnTextLinesFixEnabled
public var isExpressiveListItemHeightBasedOnTextLinesFixEnabled: Boolean = true
This flag affects overloads of ListItem and SegmentedListItem that use expressive styling.
When true (default), list item minimum height will depend on the lines of text in its content.
When false, the number of lines in a list item has no effect on its minimum height.
isModalBottomSheetStateRestorationFixEnabled
public var isModalBottomSheetStateRestorationFixEnabled: Boolean = true
When true (default), ModalBottomSheet will only trigger its initial entrance animation when SheetState.targetValue is SheetValue.Hidden, preserving restored state (e.g. expanded state) across configuration changes or process recreation.
When false, the legacy behavior is used where show() is called unconditionally.