How to Disable Edge-to-Edge Mode in Android 15 and Android 16
With each new Android version, Google continues to enhance UI experiences by embracing modern, immersive design principles. Starting with Android 10, edge-to-edge mode has become the standard, allowing apps to extend their content beneath system bars for a more immersive display. In Android 15 and the upcoming Android 16 releases, edge-to-edge mode remains a core part of the UI framework, leveraging gestures and providing richer visual experiences. However, as developers, there are times when we may want to disable edge-to-edge mode — whether for legacy app compatibility, ensuring content fidelity, or managing complex UI layouts.
In this detailed guide, we'll explore how you can disable edge-to-edge mode in Android 15 and Android 16. We will cover the background of edge-to-edge, why you might want to disable it, and provide practical Kotlin code snippets to help you control your app’s system window behavior effectively.

Android 15 and Android 16 Edge-to-Edge UI demonstration
Understanding Edge-to-Edge Mode in Modern Android
Edge-to-edge mode allows your app content to extend behind system UI elements such as the status bar, navigation bar, and display cutouts (notches). It replaces the older approach of applying opaque system bars and keeps the content fully immersive. This design aids in bringing the content closer to the edges of the device, making better use of larger screen real estate on modern phones.
When enabled (which is the default for most apps on Android 15 and 16), your layouts must handle system insets carefully to ensure content is not obscured or clipped, typically by using the WindowInsets APIs to add appropriate padding or margins.

Diagram showing edge-to-edge layout extending under status and navigation bars
Why Disable Edge-to-Edge Mode?
- Legacy App Support: Older UI components might not handle system insets well, causing clipped views or inconsistent experience.
- Consistency: In some cases, a visually consistent app UI with opaque top and bottom bars is desirable.
- Complex UI Layouts: If you have intricate views that require stable dimensions without resizing or padding shifts, turning off edge-to-edge is easier.
- Faster Development: When you want to avoid writing extra code to handle insets, disabling edge-to-edge can be the quickest solution.
How Android 15 and 16 Handle Edge-to-Edge
Android 15 and 16 continue to encourage immersive, gesture-based navigation and edge-to-edge content display as a default. However, Google offers granular control over system bars and insets via the updated WindowInsetsController and WindowCompat APIs. This lets developers programmatically enable or disable edge-to-edge mode per activity or window scene.
Here’s a quick breakdown of the APIs involved:
WindowCompat.setDecorFitsSystemWindows(window, Boolean): Controls if the app content should fit within system windows or draw edge-to-edge.WindowInsetsControllerCompat: Controls system bars behaviors including appearance and gesture handling.
Disabling Edge-to-Edge Mode Using Kotlin
By default, many new projects or templates enable edge-to-edge mode by calling:
WindowCompat.setDecorFitsSystemWindows(window, false)
This call causes your layout to draw behind system bars. To disable edge-to-edge and make your app layout fit inside system windows (status bar, navigation bar), all you need to do is pass a true parameter.
Step-by-Step Implementation
Add this snippet in your Activity’s onCreate method before setting content view:
import androidx.core.view.WindowCompat
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Disable edge-to-edge mode by fitting system windows
WindowCompat.setDecorFitsSystemWindows(window, true)
setContentView(R.layout.activity_main)
}
}
In this state, your layout will no longer extend into the status bar or navigation bar areas, and the system insets will be automatically accounted for by the framework.

Screenshot of an app with disabled edge-to-edge, showing opaque system bars
Using Jetpack Compose? Disable Edge-to-Edge Mode Here
If your app uses Jetpack Compose, you typically control edge-to-edge similarly but maybe inside your Activity or composable setup:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Disable edge-to-edge mode
WindowCompat.setDecorFitsSystemWindows(window, true)
setContent {
YourAppTheme {
// Compose UI here
}
}
}
}
Handling System Bars Appearance
Disabling edge-to-edge mode works best when your app uses opaque system bars. You can control the appearance (light or dark bars) through WindowInsetsControllerCompat.
import androidx.core.view.WindowInsetsControllerCompat
val windowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
// Optional: set light status and navigation bars for better contrast
windowInsetsController.isAppearanceLightStatusBars = true
windowInsetsController.isAppearanceLightNavigationBars = true
Ensuring proper contrast between system bars and app content improves usability.
Tips for Migrating from Edge-to-Edge to Non-Edge-to-Edge
- Remember to remove any margin or padding adjustments made for insets when edge-to-edge was enabled.
- Test on different devices with cutouts and different navbar configurations to confirm UI stability.
- Update your themes if you rely on transparent or translucent system bars.
- Use developer options to simulate cutouts or gesture navigation for thorough testing.
Summary
Edge-to-edge mode is a powerful design evolution in Android 15 and 16, letting apps offer sleek, immersive experiences. That said, it’s not always the right fit for every app or UI design. Fortunately, disabling edge-to-edge mode remains straightforward thanks to modern Android APIs.
By setting WindowCompat.setDecorFitsSystemWindows(window, true) in your activity, you ensure your app content stays within system bars, simplifying UI layout and compatibility. Combine this with WindowInsetsControllerCompat to tailor the appearance of your system bars for a polished user experience.
If you want to optimize your app’s UI for legacy designs, complex layouts, or faster development cycles, don’t hesitate to take advantage of these edge-to-edge mode toggles in Android 15 and 16.
Further Reading & Resources
- Official Android Docs on Edge-to-Edge
- WindowInsetsController API Reference
- Jetpack Core Library (WindowCompat & InsetsControllerCompat)
- Handling Window Insets in Jetpack Compose - DroidMedium
Ready to take control of your app’s UI in Android 15 and 16? Implement these tips and enjoy the best of both immersive and stable UI worlds.
Comments
Post a Comment