← Nesim Apps

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

By Nesim Razon, independent mobile developer · 2026-11-23

#Android#Jetpack Compose

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 with three buttons the last row can sit under the bar, or a bottom line can vanish. Here are three real bugs from my own apps, the fix for each, and the test routine I now use.

What edge-to-edge changed

Android's documentation says edge-to-edge is enforced once your app targets SDK 35 and runs on Android 15 or higher. The window then spans the whole display and draws behind the system bars. On earlier Android versions you get the same look by calling enableEdgeToEdge() in the activity. My apps target SDK 36, so on a current phone this is not optional.

Think of it as a change of contract. Before, the system reserved the bar areas and your layout lived in what remained. Now your layout owns the whole rectangle and you decide where the safe area starts. Most clipped UI bugs are places where nobody decided.

In Compose the two modifiers you need most are statusBarsPadding() for the top and navigationBarsPadding() for the bottom. All three bugs below are small mistakes around them.

Bug 1: the bar space belonged to an ad

In Calisan Asistani, an Android app, the home and settings screens have no banner ad. They slid under the navigation bar. I added navigationBarsPadding() to the page box and thought it was done.

A few days later it happened again. The real cause: the bottom space came only from the banner, written as Banner(Modifier.navigationBarsPadding()). When the banner was never drawn, because ads were off, consent was missing or nothing had loaded, the padding disappeared with it. The content went under the soft buttons.

The fix is to take the bar space from something that always exists. I put a box with navigationBarsPadding() at the bottom of the page, and the banner lives inside that box only on the screens that show one.

Then I tested every screen with ads on and with ads off. The rule is simple: if a padding is attached to an element that can be absent, move it to its parent. This bug needs a specific state, no ad, so it only shows if you test that state on purpose.

Bug 2: padding in the wrong place

In Pentolings, the settings and statistics content flowed under the navigation buttons. The memory note I keep for this says it came back after I had fixed it in other games. The cause was the order of modifiers on a scrolling column.

My explanation from the notes: when the padding comes after verticalScroll, it is added inside the scrolled content. The visible window of the list still reaches the bottom edge of the screen, so the content shows through behind the buttons. When the padding comes first, the window itself ends above the bar. The Pentolings screens now use the second order, for example in HelpScreen.kt and Screens.kt.

A quick check for this bug: scroll to the very end of the screen. The last item must stop fully above the bar, with a little space. If it stops behind the bar, the order is wrong.

Bug 3: a weight squeezed to zero

The settings screen of Slinglings is a column with a title, switches, buttons, a decorative desk scene and a version line. The desk scene used weight(1f) to take whatever height was left, and the version line sat below it.

When the rows above filled the screen, nothing was left for the weight. The scene shrank to zero height and the version line at the very bottom was cut off. A taller phone hid the problem, so it only showed on a small screen.

The column is now scrollable and the scene has a fixed height. If the content does not fit, the user scrolls instead of losing a line. The same commit also stopped the version line from being a hard-coded text: it reads the real version name now.

There were two ways out: give flexible items a minimum height, or make the screen scrollable. I chose scrolling plus a fixed height, because on a small phone the decorative scene is the first thing to give up.

Which inset for which job

Compose offers several inset modifiers. You do not need all of them, but it helps to know what each one answers.

The Android documentation also lists display cutout insets and system gesture insets. The gesture insets matter when your own swipes start near the screen edge; the docs mention swiping in games as an example. My screens mostly use the first two modifiers. I have not needed more, so I cannot tell you from experience how the others behave in every case.

Large text and longer languages

Fixed heights are risky in the other direction too. A button with a fixed height cuts its label when the user sets a larger font. In Pentolings the shared button uses heightIn(min = ...) so it can grow with the text.

In my notes for other apps I also planned to test at 1.3x and 1.5x font size, because Spanish and Portuguese labels are longer than English ones. I have not run that test on every app yet, and I do not claim it. I treat it as a checklist item, not a result.

Do the arithmetic: at a 1.3 font scale a 14 sp label is drawn at about 18 sp, so the same words need roughly 30 percent more width. A label that fit on one line may now need two, or be cut.

In the Tilelings design notes I wrote a rule for long labels: one line only, a measurement test, and a fallback to 11 sp, checked on a small phone with a 1.3x font. That is a plan from the notes, not a measured result. The same notes list 48 dp touch targets, so a button never shrinks below a finger-sized area.

The test routine

Gesture navigation hides most of these bugs, so I test with the other mode. This is the routine.

Before each release I now ask three questions. Is the last item of every scrolling screen fully above the bar? Does any bottom space depend on an optional element? Does any flexible item have a fixed minimum? Each step above reproduces one bug: three buttons show bugs 1 and 2, a small screen shows bug 3, a large font shows the cut labels, and ads off shows bug 1 again.

Frequently asked questions

From which target SDK is edge-to-edge enforced?

According to the Android documentation, edge-to-edge is enforced on Android 15 (API level 35) and higher once your app targets SDK 35.

Does navigationBarsPadding() go before or after verticalScroll?

Before. Placed after, the padding scrolls with the content and the list still shows behind the navigation bar.

Why does my UI look fine on gesture navigation but break with three buttons?

With three buttons a real, translucent navigation bar covers the bottom of the window, so any content without bottom padding sits under it.

Why did my bottom line disappear on a small screen?

A weight(1f) item shrinks to zero when the other items fill the screen. Make the screen scrollable and give that item a fixed height.

More from the blog