# SystemBarStyle

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/EdgeToEdge.kt+class:androidx.activity.SystemBarStyle) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) Deprecated in [1.14.0-alpha03](https://developer.android.com/jetpack/androidx/releases/activity#1.14.0-alpha03)

*** ** * ** ***


```
public final class SystemBarStyle
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> SystemBarStyle was used to configure enableEdgeToEdge. Use WindowCompat.enableEdgeToEdge(Window), WindowCompat.getInsetsController(Window, View), and ProtectionLayout instead.

The style for the status bar or the navigation bar used in `https://developer.android.com/reference/androidx/activity/package-summary#(androidx.activity.ComponentActivity).enableEdgeToEdge(androidx.activity.SystemBarStyle,androidx.activity.SystemBarStyle)`.

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle` | `[auto](https://developer.android.com/reference/androidx/activity/SystemBarStyle#auto(kotlin.Int,kotlin.Int,kotlin.Function1))( @https://developer.android.com/reference/androidx/annotation/ColorInt int lightScrim, @https://developer.android.com/reference/androidx/annotation/ColorInt int darkScrim, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> detectDarkMode )` **This method is deprecated.** SystemBarStyle was used to configure enableEdgeToEdge. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle` | `[dark](https://developer.android.com/reference/androidx/activity/SystemBarStyle#dark(kotlin.Int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int scrim)` **This method is deprecated.** SystemBarStyle was used to configure enableEdgeToEdge. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle` | `[light](https://developer.android.com/reference/androidx/activity/SystemBarStyle#light(kotlin.Int,kotlin.Int))(@https://developer.android.com/reference/androidx/annotation/ColorInt int scrim, @https://developer.android.com/reference/androidx/annotation/ColorInt int darkScrim)` **This method is deprecated.** SystemBarStyle was used to configure enableEdgeToEdge. |

## Public methods

### auto

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) Deprecated in [1.14.0-alpha03](https://developer.android.com/jetpack/androidx/releases/activity#1.14.0-alpha03)

```
public static final @NonNull SystemBarStyle [auto](https://developer.android.com/reference/androidx/activity/SystemBarStyle#auto(kotlin.Int,kotlin.Int,kotlin.Function1))(
    @ColorInt int lightScrim,
    @ColorInt int darkScrim,
    @NonNull Function1<@NonNull Resources, @NonNull Boolean> detectDarkMode
)
```

> [!CAUTION]
> **This method is deprecated.**   
> SystemBarStyle was used to configure enableEdgeToEdge. Use WindowCompat.enableEdgeToEdge(Window), WindowCompat.getInsetsController(Window, View), and ProtectionLayout instead.

Creates a new instance of `https://developer.android.com/reference/androidx/activity/SystemBarStyle`. This style detects the dark mode automatically and applies the recommended style for each of the status bar and the navigation bar. If this style doesn't work for your app, consider using either `https://developer.android.com/reference/androidx/activity/SystemBarStyle#dark(kotlin.Int)` or `https://developer.android.com/reference/androidx/activity/SystemBarStyle#light(kotlin.Int,kotlin.Int)`.

- On API level 29 and above, both the status bar and the navigation bar will be transparent. However, the navigation bar with 3 or 2 buttons will have a translucent scrim. This scrim color is provided by the platform and *cannot be customized*.

- On API level 28 and below, the status bar will be transparent, and the navigation bar will have one of the specified scrim colors depending on the dark mode.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int lightScrim` | The scrim color to be used for the background when the app is in light mode. Note that this is used only on API level 28 and below. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int darkScrim` | The scrim color to be used for the background when the app is in dark mode. This is also used on devices where the system icon color is always light. Note that this is used only on API level 28 and below. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> detectDarkMode` | Optional. Detects whether UI currently uses dark mode or not. The default implementation can detect any of the standard dark mode features from the platform, appcompat, and Jetpack Compose. |

### dark

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) Deprecated in [1.14.0-alpha03](https://developer.android.com/jetpack/androidx/releases/activity#1.14.0-alpha03)

```
public static final @NonNull SystemBarStyle [dark](https://developer.android.com/reference/androidx/activity/SystemBarStyle#dark(kotlin.Int))(@ColorInt int scrim)
```

> [!CAUTION]
> **This method is deprecated.**   
> SystemBarStyle was used to configure enableEdgeToEdge. Use WindowCompat.enableEdgeToEdge(Window), WindowCompat.getInsetsController(Window, View), and ProtectionLayout instead.

Creates a new instance of `https://developer.android.com/reference/androidx/activity/SystemBarStyle`. This style consistently applies the specified scrim color regardless of the system navigation mode.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int scrim` | The scrim color to be used for the background. It is expected to be dark for the contrast against the light system icons. |

### light

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/activity#1.8.0) Deprecated in [1.14.0-alpha03](https://developer.android.com/jetpack/androidx/releases/activity#1.14.0-alpha03)

```
public static final @NonNull SystemBarStyle [light](https://developer.android.com/reference/androidx/activity/SystemBarStyle#light(kotlin.Int,kotlin.Int))(@ColorInt int scrim, @ColorInt int darkScrim)
```

> [!CAUTION]
> **This method is deprecated.**   
> SystemBarStyle was used to configure enableEdgeToEdge. Use WindowCompat.enableEdgeToEdge(Window), WindowCompat.getInsetsController(Window, View), and ProtectionLayout instead.

Creates a new instance of `https://developer.android.com/reference/androidx/activity/SystemBarStyle`. This style consistently applies the specified scrim color regardless of the system navigation mode.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int scrim` | The scrim color to be used for the background. It is expected to be light for the contrast against the dark system icons. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int darkScrim` | The scrim color to be used for the background on devices where the system icon color is always light. It is expected to be dark. |