Skip to content

Lift snackbars above the navigation bar and keyboard - #783

Merged
andiwand merged 1 commit into
mainfrom
fix-snackbar-inset
Nov 28, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix-snackbar-inset

Conversation

@andiwand

@andiwand andiwand commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Fixes #782.

MainActivity.applyWindowInsets consumes the insets at the decor and pads it only left, top and right, so a snackbar parented to android.R.id.content never saw the bottom bar. Material lifted it only by the mandatory gesture inset, which is 0 with 3-button navigation, so the bar covered part of it.

SnackbarHelper now adds the root's bottom system-bar and keyboard inset to the snackbar's margin. Material's own gesture inset only adds what that margin lacks, so nothing is lifted twice.

Checked on a Pixel 9 Pro emulator with an editRefused snackbar over a document: on main it reached the screen's bottom edge in both navigation modes, over the gesture handle too. Now it ends above the bar in both (3-button: text ends at y 2688, bar starts at 2712; gesture: 2760 and 2784).

The snackbar still covers the bottom of the document's floating buttons, as it did before; they are not in a CoordinatorLayout. No changelog entry here, since Unreleased arrives with #781.

MainActivity consumes the window insets at the decor, so a snackbar parented to the content
never saw the bottom bar: with 3-button navigation it sat partly behind it. SnackbarHelper now
adds the root's bottom system-bar and keyboard inset to its margin; Material's gesture inset
only tops up what is missing, so gesture navigation does not lift it twice.

Fixes #782

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FW6WZZfQGJ4fuTzVR4DhYg
@andiwand
andiwand merged commit bcdd314 into main Nov 28, 2026
7 checks passed
@andiwand
andiwand deleted the fix-snackbar-inset branch November 28, 2026 18:38
@andiwand andiwand mentioned this pull request Nov 28, 2026
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.

Snackbar is partly hidden behind the navigation bar

1 participant