Skip to content

Conversation

@JiaxinLi1122
Copy link

@JiaxinLi1122 JiaxinLi1122 commented Oct 25, 2025

Issue
Fixes #6495

Cause
The root FrameLayout did not account for system window insets, and the bottom LinearLayout was aligned directly to the screen bottom without padding.

Fix
Added android:fitsSystemWindows="true" to the root layout.
Added android:paddingBottom="24dp" to the bottom button layout to provide safe spacing.

Result
Buttons are now fully visible across devices (confirmed on Galaxy S23 API 35 emulator).

Screenshots
before:
image
after:
image

Summary by CodeRabbit

  • Bug Fixes
    • Fixed layout display to properly accommodate system interface elements, preventing content from overlapping with status and navigation bars.

JiaxinLi1122 and others added 2 commits October 25, 2025 22:13
…creen (commons-app#6495)"

This reverts commit babc06d.

Revert "Fix bottom buttons overlapping navigation bar in Edit Image screen (commons-app#6495)"#
android:layout_height="wrap_content"
android:layout_margin="2dp">
android:layout_margin="2dp"
android:paddingBottom="24dp">
Copy link
Member

Choose a reason for hiding this comment

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

Is this paddingBottom really needed? Would you mind posting a screenshot showing how the screen looks like when the OS is configured to not show the navigation buttons?

Thanks a lot for contributing! :-)

Copy link
Author

Choose a reason for hiding this comment

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

Here is Samsung Galaxy S23 (Android 15, API 35) without navigation buttons:image

Copy link
Author

Choose a reason for hiding this comment

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

I think the extra padding can be removed — it was mostly for visual spacing, to make the buttons look less close to the navigation bar.

Copy link
Member

Choose a reason for hiding this comment

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

Understood! Better remove it I guess, so that the space can be used on small screens or in landscape mode.

Copy link
Author

Choose a reason for hiding this comment

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

done!

@coderabbitai
Copy link

coderabbitai bot commented Oct 26, 2025

Walkthrough

Added the android:fitsSystemWindows="true" attribute to the root FrameLayout in the edit activity layout file. This attribute instructs the layout to adjust its dimensions to accommodate system window insets, such as navigation bars and status bars, preventing UI elements from being obscured.

Changes

Cohort / File(s) Summary
System insets adjustment
app/src/main/res/layout/activity_edit.xml
Added android:fitsSystemWindows="true" to root FrameLayout to ensure layout respects system window insets and prevents buttons from being covered by navigation bar

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single attribute addition to XML layout
  • No structural or logic changes
  • Straightforward system inset handling

Poem

🐰 A button hidden is a button lost,
Beneath the nav bar, covered with frost,
So we add a whisper to the frame so true:
"Please respect the space reserved for you!" ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The linked issue #6495 identifies two distinct sets of buttons that need to be fixed across two separate screens: map view buttons ("Remove location", "Edit location", "Show in map app") and Edit Image screen buttons ("Rotate", "Save"). However, the raw_summary shows changes only to activity_edit.xml, addressing only the Edit Image screen. The raw_summary provides no evidence of changes to map view layouts, which suggests the map view portion of issue #6495 may not be addressed in this pull request. This creates a significant gap between the stated PR objectives and the actual code changes provided. The pull request should be updated to include layout fixes for both affected screens mentioned in issue #6495. Verify that changes are made to the map view layout file in addition to activity_edit.xml, or clarify whether the map view fix is being addressed in a separate pull request. Ensure all screens referenced in the linked issue receive the necessary system window inset handling.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Fix: Bottom buttons overlapping navigation bar in Edit Image screen (#6495)" clearly and specifically describes the main change—adding system window inset handling to prevent button overlap. The title is concise, directly related to the core issue being addressed, and provides enough context for a reviewer scanning the commit history to understand the primary objective without needing to examine the details.
Out of Scope Changes Check ✅ Passed The changes visible in the raw_summary are directly scoped to fixing the button overlap issue identified in #6495. The addition of android:fitsSystemWindows="true" to the root FrameLayout in activity_edit.xml is a targeted fix for the stated problem with no extraneous modifications observed. The change is minimal and focused on the specific layout issue, with no unrelated alterations to other components or functionality.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e81f916 and 7d6ad40.

📒 Files selected for processing (1)
  • app/src/main/res/layout/activity_edit.xml (1 hunks)
🔇 Additional comments (1)
app/src/main/res/layout/activity_edit.xml (1)

7-7: Excellent fix—minimal and idiomatic.

The addition of android:fitsSystemWindows="true" on the root FrameLayout is the correct solution. This attribute instructs the system to adjust the layout's padding to accommodate system window insets (navigation bar, status bar), allowing child views positioned with layout_gravity="bottom" to render within the safe area rather than beneath the navigation bar.

The decision to remove the arbitrary android:paddingBottom (per the earlier review discussion) is sound—it preserves screen real estate on constrained devices and in landscape mode while maintaining accessibility across configurations.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Unfortunately I still see overlap with this branch:

Screenshot_20251103-124714

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.

[Bug]: "Remove location", "Edit location", and "Show in map app" buttons are covered by the bottom system navigation bar

3 participants