# EdgeToEdge

Added in 1.8.0

*** ** * ** ***


```
public final class EdgeToEdge
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final void` | `[enable](https://developer.android.com/reference/androidx/activity/EdgeToEdge#(androidx.activity.ComponentActivity).enable(androidx.activity.SystemBarStyle,androidx.activity.SystemBarStyle))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/ComponentActivity receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle statusBarStyle, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle navigationBarStyle )` **This method is deprecated.** Use {@link WindowCompat#enableEdgeToEdge(Window)} to enable edge-to-edge display. |

## Public methods

### enable

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+function:enableEdgeToEdge) 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 void [enable](https://developer.android.com/reference/androidx/activity/EdgeToEdge#(androidx.activity.ComponentActivity).enable(androidx.activity.SystemBarStyle,androidx.activity.SystemBarStyle))(
    @NonNull ComponentActivity receiver,
    @NonNull SystemBarStyle statusBarStyle,
    @NonNull SystemBarStyle navigationBarStyle
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use {@link WindowCompat#enableEdgeToEdge(Window)} to enable edge-to-edge display. To adjust the light/dark appearance of system bar icons, use {@link WindowInsetsControllerCompat#setAppearanceLightStatusBars(boolean)} or {@link WindowInsetsControllerCompat#setAppearanceLightNavigationBars(boolean)}. To add scrim or background protection, use {@link ProtectionLayout} or handle insets directly in your view hierarchy, use this instead:
>
> ```
> WindowCompat.enableEdgeToEdge(window)
> ```

Enables the edge-to-edge display for this `https://developer.android.com/reference/androidx/activity/ComponentActivity`.

To set it up with the default style, call this method in your Activity's onCreate method:

```
    override fun onCreate(savedInstanceState: Bundle?) {
        enableEdgeToEdge()
        super.onCreate(savedInstanceState)
        ...
    }
```

The default style configures the system bars with a transparent background when contrast can be enforced by the system (API 29 or above). On older platforms (which only have 3-button/2-button navigation modes), an equivalent scrim is applied to ensure contrast with the system bars.

See `https://developer.android.com/reference/androidx/activity/SystemBarStyle` for more customization options.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle statusBarStyle` | The `https://developer.android.com/reference/androidx/activity/SystemBarStyle` for the status bar. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/SystemBarStyle navigationBarStyle` | The `https://developer.android.com/reference/androidx/activity/SystemBarStyle` for the navigation bar. |