Skip to content

Add Apply Window Insets Listener to Floating Action Button on Collaborators and Edit Tags Screens#1739

Merged
mzorz merged 3 commits intoAutomattic:mzorz/update-targetsdk-35from
theck13:heck/update-targetsdk-35
Aug 4, 2025
Merged

Add Apply Window Insets Listener to Floating Action Button on Collaborators and Edit Tags Screens#1739
mzorz merged 3 commits intoAutomattic:mzorz/update-targetsdk-35from
theck13:heck/update-targetsdk-35

Conversation

@theck13
Copy link
Contributor

@theck13 theck13 commented Aug 3, 2025

Fix

After the changes up to be33637 in #1737, the floating action button on the Collaborators and Edit Tags screens overlaps the system navigation bar. The setOnApplyWindowInsetsListener method described in the official documentation to Display Content Edge-to-Edge in Views under the Handle Overlaps Using Insets section was used after lines 81/92 in CollaboratorsActivity.kt and 64/75 in TagsActivity.kt in #1737 to fix the issue. See the screenshots below for illustration.

Screenshots

Collaborators

Before After
1737_update_android_15_collaborators_before 1737_update_android_15_collaborators_after

Edit Tags

Before After
1737_update_android_15_tags_before 1737_update_android_15_tags_after

Test

Follow the steps below to test the Add Collaborator and Add Tag floating action buttons on the Collaborators and Edit Tags screens respectively.

Collaborators

  1. Tap any note in list with at least one collaborator.
  2. Tap ellipsis/overflow button in top app bar.
  3. Tap Collaborators item in menu.
  4. Notice Add Collaborator floating action button does not overlap system navigation bar.
  5. Tap back arrow in top app bar.
  6. Tap back arrow in top app bar.
  7. Tap any note in list with no collaborators.
  8. Tap ellipsis/overflow button in top app bar.
  9. Tap Collaborators item in menu.
  10. Notice Add Collaborator floating action button does not overlap system navigation bar.

Edit Tags

  1. Open navigation drawer.
  2. Tap Edit button in Tags section.
  3. Notice Add Tag floating action button does not overlap system navigation bar.

Review

Only one developer is required to review these changes, but anyone can perform the review.

Release

These changes do not require release notes.

Comment on lines +170 to +174
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
bottom = insets.getInsets(WindowInsets.Type.systemBars()).bottom;
} else {
bottom = insets.getSystemWindowInsetBottom();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since WindowInsets.getSystemWindowInsetBottom() was deprecated in API 30, Build.VERSION.SDK_INT >= Build.VERSION_CODES.R condition ensures the deprecated statement won't be used in API 30 or later with WindowInsets.getInsets(WindowInsets.Type.systemBars()).bottom used instead.

Copy link
Contributor

@mzorz mzorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theck13 !!! 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 😍 so nice to see you!

I love you man, thanks for spotting this corner I missed and adding the contribution, you're awesome!! 🥇 ✨ 💖 🙇

@mzorz mzorz merged commit e79e7e4 into Automattic:mzorz/update-targetsdk-35 Aug 4, 2025
1 check passed
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.

2 participants