Object

ComposeMaterial3Flags

The object holding the feature flags.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Common
@ExperimentalMaterial3Api
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

Common
@JvmField var isCheckboxStylingFixEnabled: Boolean

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.

Common
@JvmField var isSnackbarStylingFixEnabled: Boolean

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

Common
@JvmField
var isPrecisionPointerComponentSizingEnabled: Boolean

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

Common
@JvmField
var isAnchoredDraggableComponentsStrictOffsetCheckEnabled: Boolean

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.

Common
@JvmField
var isAnchoredDraggableComponentsInvalidationFixEnabled: Boolean

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.

Common
@JvmField
var isAnchoredDraggableComponentsAnchorRecoveryEnabled: Boolean

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, Material3 components using AnchoredDraggable will attempt to recover from orphaned targets (targets not present in the anchor set) during anchor updates. This prevents the internal offset from becoming NaN.