DEV Community

Cover image for Edge-to-Edge and 3-Button Navigation: Fixing Clipped Compose UI

Edge-to-Edge and 3-Button Navigation: Fixing Clipped Compose UI

Nesim Razon on November 23, 2026

After your app targets SDK 35, the system draws it behind the status bar and the navigation bar. On a gesture phone it often looks fine. On a phone...
Collapse
 
prikshit profile image
Prikshit •

The banner bug is the one that hides in review: navigationBarsPadding() on an optional ad vanishes when the ad is off, and gesture navigation never shows it. Putting the padding on a parent that always exists, and putting it before verticalScroll, are the two rules I'd keep. Testing with three-button navigation and ads off is the only way those two stay fixed.

Collapse
 
nesimrazon profile image
Nesim Razon •

Exactly, "ads off + three buttons" is the combination that exposed it for me. Thanks for reading so closely.

Collapse
 
prikshit profile image
Prikshit •

Ads off plus three button nav is a nasty pairing because neither shows up in the default emulator setup. A screenshot test that runs once with gesture nav and once with three button nav would keep the banner case from quietly coming back. Did the fix end up as windowInsetsPadding on the banner container itself, or on the parent Scaffold?

Thread Thread
 
nesimrazon profile image
Nesim Razon •

It's neither, actually. The fix is a plain Box at the bottom of the page column with navigationBarsPadding(), and the banner is drawn inside it only on the screens that show one.
So the inset sits on a container that always exists, and the banner is optional inside it. There's no Scaffold in that app.

And your screenshot-test idea is the right next step: right now my gesture vs three-button check is a manual emulator routine, not an automated test,
which is exactly why the banner case could come back unnoticed. I'll look at turning it into a test that runs both modes.

Thread Thread
 
prikshit profile image
Prikshit •

Putting the inset on a Box that always exists and keeping the banner optional inside it means the padding no longer depends on whether an ad loaded. When you write the test I'd run it with the banner present and absent as well, because the empty Box still reserving the nav bar height is the case a gesture nav run would never show you.

Thread Thread
 
nesimrazon profile image
Nesim Razon •

Right, and that reserved height is intended: with no banner the Box is empty but still holds the nav bar inset, so the content ends above the bar.
What the test has to prove is that this height is identical with the banner present and absent. A layout that shifts when the ad loads would mean the padding leaked back onto the banner. So the matrix is two nav modes times two banner states, and I'd assert on the bottom of the last item rather than only eyeballing a screenshot. It's still a manual emulator routine for me today, so I'll write it down as a four-case checklist first and automate it after.

Collapse
 
userxnom profile image
Abdullah Naseer •

Bug 2 is the one I'd have gotten wrong — I'd have assumed navigationBarsPadding() works the same anywhere in the modifier chain. Have you run into the same ordering trap with imePadding() inside a scrolling column, or does the keyboard resizing the window make that one more forgiving? And in your test routine, does the Android 11 emulator catch anything the 1.3x font scale run doesn't, or is it mainly there for the 3-button bar?

Collapse
 
nesimrazon profile image
Nesim Razon •

Honest answer: I have not tested the ordering with imePadding() inside a scrolling column, so I cannot say from experience. I only know it from the docs that the keyboard is a separate inset, and the same logic (padding before verticalScroll) should apply, but please check it on a real device.
On the emulator: it is mainly there for the three-button bar. The Android 11 image gives me that bar quickly. The 1.3x font scale is a separate run on top of it, and it catches different bugs (cut labels, buttons with a fixed height), not the bar ones. So the two runs find different things.

Collapse
 
mosmox_studio profile image
Mosmox Studio •

Bug 1 is such a good example of a layout that only breaks in one specific state. Moving the inset to something that always exists is a rule worth keeping. One trade-off with putting navigationBarsPadding() before verticalScroll: the scroll viewport ends above the bar, so content never passes behind the translucent bar. If you want the full edge-to-edge look on a LazyColumn, passing WindowInsets.navigationBars.asPaddingValues() as contentPadding lets items scroll behind the bar while the last one still stops above it.

Collapse
 
nesimrazon profile image
Nesim Razon •

Thanks, that is a good point and I had not considered it. My screens are mostly plain scrolling columns, so I kept the whole viewport above the bar. For a LazyColumn, contentPadding with the navigationBars insets gives the nicer edge-to-edge look: items pass behind the translucent bar and the last one still stops above it. I will use that where a list is the main content.

Collapse
 
arpit_mishra1 profile image
Arpit Mishra •

Useful breakdown. One more trap I have seen alongside Bug 2: nested Scaffolds. If a screen-level Scaffold sits inside an app-level Scaffold and both apply innerPadding, the bottom inset gets added twice and you end up with a gap above the bar instead of content under it. Calling Modifier.consumeWindowInsets(innerPadding) on the outer content stops the inner layout from padding again. Worth adding to the three-button test run, since the double gap is easy to miss on gesture navigation too.

Collapse
 
nesimrazon profile image
Nesim Razon •

Good one, thanks. I haven't hit that one because my apps don't use Scaffold at all, they apply the insets by hand, so I can't say anything from experience about the double bottom inset.
It's worth adding to the three-button checklist for anyone using nested Scaffolds, and a double gap above the bar is exactly the kind of thing gesture navigation hides.