Is Your Android App Broken on API 35? 📱💥 The Edge-to-Edge Survival Guide
A 3-step survival guide to mastering mandatory Edge-to-Edge layouts in Android 15
If you’ve recently bumped your targetSdkVersion to 35 (Android 15), you might have noticed something jarring: your beautiful layout is suddenly shoved behind the status bar, or your bottom navigation is drowning in the navigation bar.
Android 15 doesn’t break your UI — it exposes assumptions your layout has been making for years.
The Big Shift: Edge-to-Edge is No Longer Optional
In previous versions of Android, developers had a choice. You could stay within the “safe zones” or manually request to go “edge-to-edge.” Starting with Android 15, Google has flipped the switch. For apps targeting API 35, Edge-to-Edge is mandatory.
Why the change?
Google is pushing for a cohesive, premium look. By removing the solid bars at the top and bottom, apps feel like an integrated part of the device hardware. Think of it as painting the entire canvas, then placing your UI safely inside the frame using insets.
What has actually changed?
- System UI Flags No Longer Control Layout: Legacy
View.SYSTEM_UI_FLAG_*constants no longer influence layout behavior on API 35+. - Default Transparency: The system forces the status and navigation bars to be transparent. While APIs like
setStatusBarColorstill exist, they no longer prevent content from drawing behind the bars. - Enforced Overlap: Your app draws behind system bars by default. If you don’t handle insets, your interactive elements will be unclickable and your text unreadable.
How to Fix Your UI in 3 Steps
If your content is overlapping with the clock or the gesture pill, follow this roadmap.
1. Enable it Explicitly (Backward Compatibility)
Even though API 35 forces this, call enableEdgeToEdge() in your Activity’s onCreate. This ensures your app looks modern on Android 10 through 14 as well.
override fun onCreate(savedInstanceState: Bundle?) {
// 1. Must be called BEFORE setContentView
enableEdgeToEdge()
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}2. The Solution: Handle WindowInsets
Instead of hardcoding padding (an official anti-pattern!), we use a listener. This asks the system for the exact dimensions of the bars — accounting for notches and navigation styles.
// Apply this to your root view or specific containers
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main_root)) { v, insets ->
// Fetch system bars (status/nav) and physical cutouts (notches)
val bars = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or
WindowInsetsCompat.Type.displayCutout()
)
// Update padding dynamically
v.updatePadding(
left = bars.left,
top = bars.top,
right = bars.right,
bottom = bars.bottom
)
// Return the insets.
// Use .CONSUMED only if children should NOT receive these insets.
insets
}🛑 Common Mistakes to Avoid
- Double-Padding: Applying insets to both a parent container and its children, resulting in massive, awkward gaps. (Compose users: apply insets at the Scaffold or top-level composable to avoid this).
- Forgetting Dialogs: Not handling insets for Bottom Sheets or Dialogs, which often live in their own windows and won’t inherit root padding.
- Hardcoded Values: Guessing that a status bar is “24dp.” Devices vary wildly; always trust the
WindowInsetsobject.
✅ API 35 Edge-to-Edge Migration Checklist
- [ ] Call
enableEdgeToEdge()beforesetContentView. - [ ] Replace all
systemUiVisibilitylogic withWindowInsets. - [ ] Apply
WindowInsetslisteners to root containers or Scaffolds. - [ ] Explicitly verify Dialogs and Bottom Sheets on a real device.
- [ ] Test on both Gesture Navigation and 3-Button Navigation.
- [ ] Test on a device with a Display Cutout (notch/hole-punch).
🙋♂️ Frequently Asked Questions (FAQs)
Can I opt-out of Edge-to-Edge on Android 15?
Technically, no. If you target API 35, the system forces this behavior. You must manage the layout yourself.
Does this affect Jetpack Compose?
Yes, but it’s much simpler! Use Modifier.safeDrawingPadding() or Modifier.windowInsetsPadding(WindowInsets.systemBars) on your top-level Composables.
Why is my background color appearing behind the status bar now?
That’s the intended behavior! Your background should bleed into the status area, while your content (text, buttons) stays safe via insets.
Join the Conversation 💬
- Have you bumped your
targetSdkVersionto 35 yet? What was the first thing that "broke"? - Are you finding
WindowInsetseasier to manage in XML or Jetpack Compose? - Do you think this mandatory change is better for the ecosystem?
Drop a comment below and let’s help each other transition!
📘 Master Your Next Technical Interview
Since Java is the foundation of Android development, mastering DSA is essential. I highly recommend “Mastering Data Structures & Algorithms in Java”. It’s a focused roadmap covering 100+ coding challenges to help you ace your technical rounds.
- E-book (Best Value! 🚀): $1.99 on Google Play
- Kindle Edition: $3.49 on Amazon
- Also available in Paperback & Hardcover.

Comments
Post a Comment