Skip to content

Handle window insets in BackupsPreferenceFragment - #15151

Open
SageDroid wants to merge 1 commit into
signalapp:mainfrom
SageDroid:issue/15150_handle_window_insets
Open

SageDroid wants to merge 1 commit into
signalapp:mainfrom
SageDroid:issue/15150_handle_window_insets

Conversation

@SageDroid

Copy link
Copy Markdown

Fixes #15150

First time contributor checklist

Contributor checklist

  • Pixel 9 Pro, Android 17
  • Virtual device Pixel 10 Pro Fold, Android 17
  • Virtual device Nexus 6P, Android 6
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

BackupsPreferenceFragment didn't handle window insets, and had its Toolbar inside the NestedScrollView. As a result, the toolbar overlapped the status bar and scrolled off-screen with the content. In addition the bottom content was drawn behind the navigation bar, which made “Learn more” unclickable or, in some cases, completely invisible.

Changes

  • Moved the Toolbar out of NestedScrollView into a vertical LinearLayout root in fragment_backups.xml and set clipToPadding="false" on the scroll view.
  • Applied status bar insets to the toolbar via HostInsets.insetToolbarForStatusBar and navigation bar insets to the scroll view via SystemWindowInsetsSetter.attach, guarded by !HostInsets.isInsetByHost(this) to avoid double insets in split-pane settings (matching EditProxyFragment).

Note: Most of the diff is re-indentation. The real change is about 15 lines. The ids and content are the same as before.

Testing

  • Tested on Android 17 with both three-button and gesture navigation as well as on Android 6 with three-button navigation. I tested scrolling from top to bottom and verified the toolbar stays pinned below the status bar. The bottom content now scrolls above the navigation bar.
Screenshots before this change Screenshot_1795885660 Screenshot_1795885680 Screenshot_1795885750 Screenshot_1795889535
Screenshots after this change Screenshot_1795889184 Screenshot_1795889188 Screenshot_1795889160 Screenshot_1795894742 Screenshot_1795889301

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.

Legacy Chat backups screen overlaps status and navigation bars

1 participant