Skip to content

Fix bottom nav bar overlap on edge-to-edge displays - #597

Merged
kasnder merged 1 commit into
masterfrom
claude/fix-insets-585
Jul 11, 2026
Merged

Fix bottom nav bar overlap on edge-to-edge displays#597
kasnder merged 1 commit into
masterfrom
claude/fix-insets-585

Conversation

@kasnder

@kasnder kasnder commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the main screen's BottomNavigationView being obscured by the system gesture/navigation bar on API 35+ (edge-to-edge, which Android 15 enforces).

The existing per-activity pattern already pads the toolbar (appbar) for the top status-bar inset. What was missing on the main screen was bottom inset handling — the BottomNavigationView at the bottom of main.xml had no padding for the nav bar. This adds one narrowly-scoped OnApplyWindowInsetsListener on bottomNav that pads it by the systemBars left/right/bottom insets (preserving any initial padding) and returns insets so nested consumers still receive them.

Relationship to #585

Supersedes and closes #585. That PR (thanks @NYBACHOK for surfacing the issue) added a second, root-level listener on android.R.id.content returning WindowInsetsCompat.CONSUMED. That competes with the existing appbar listener and swallows insets before they reach the views that need them — the exact double-inset failure mode this project already fixed once in cd9887a ("Fix doubled top inset gap on Insights toolbar"). This version instead follows the codebase's established single-responsibility, non-consuming inset pattern.

Notes

  • Only ActivityMain.java changed (+13 lines); no layout edits.
  • IME insets deliberately omitted — the only text input is the top-of-screen toolbar SearchView, which the keyboard never covers.

Test plan

  • On an API 35+ device/emulator with gesture nav, verify the bottom navigation sits fully above the nav bar (not underneath it).
  • Verify the toolbar top inset is unchanged (no doubled gap).
  • Verify landscape / three-button nav still lays out correctly.

🤖 Generated with Claude Code

PR #585 tried to fix status/nav bar overlap by adding a second
setOnApplyWindowInsetsListener on the root content view that returns
WindowInsetsCompat.CONSUMED. That competes with the existing listener
on the AppBarLayout (which pads it for the status bar) and starves
child views of insets needed further down the tree — the same
double-counted-inset bug already fixed once for Insights in cd9887a.

Instead, extend the established per-view listener pattern (already
used for the AppBarLayout here, and for ActivitySettings/DetailsActivity/
InsightsActivity) with one more, non-competing listener on the
BottomNavigationView: pad it by the system bars inset (left/right/bottom)
so it isn't obscured by the gesture/navigation bar on API 35+, while
still propagating insets (return insets, not CONSUMED) instead of
consuming them at the root.

No IME handling is needed here: the only text input (search) lives in
the toolbar, not behind the keyboard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kasnder kasnder mentioned this pull request Jul 10, 2026
@kasnder
kasnder merged commit bcf6115 into master Jul 11, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant