applyEdgeToEdge

open fun applyEdgeToEdge(@NonNull window: Window, edgeToEdgeEnabled: Boolean)

Applies or removes edge-to-edge mode to the provided Window. When edge-to-edge mode is applied, the activities, or the non-floating dialogs, that host the provided window will be drawn over the system bar area by default and the system bar colors will be adjusted according to the background color you provide.


open fun applyEdgeToEdge(@NonNull window: Window, edgeToEdgeEnabled: Boolean, @Nullable @ColorInt statusBarOverlapBackgroundColor: Integer, @Nullable @ColorInt navigationBarOverlapBackgroundColor: Integer)

Applies or removes edge-to-edge mode to the provided Window. When edge-to-edge mode is applied, the activities, or the non-floating dialogs, that host the provided window will be drawn over the system bar area by default and the system bar colors will be adjusted according to the background color you provide.

Parameters

statusBarOverlapBackgroundColor

The reference background color to decide the text/icon colors on status bars. null to use the default color from ?android:attr/colorBackground.

navigationBarOverlapBackgroundColor

The reference background color to decide the icon colors on navigation bars.null to use the default color from ?android:attr/colorBackground.