Skip to content

Made layouts for appscreen and libraryscreen cutout/notch aware#1299

Merged
utkarshdalal merged 1 commit intomasterfrom
remove-status-bar
Apr 26, 2026
Merged

Made layouts for appscreen and libraryscreen cutout/notch aware#1299
utkarshdalal merged 1 commit intomasterfrom
remove-status-bar

Conversation

@utkarshdalal
Copy link
Copy Markdown
Owner

@utkarshdalal utkarshdalal commented Apr 26, 2026

Description

made the UI aware of notches

Recording

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Make the Library and App screens notch/cutout aware so content and controls don’t sit under the status bar or camera hole. Hero images remain full-bleed; interactive elements get safe padding.

  • Bug Fixes
    • Opted into display cutouts with shortEdges in themes.xml.
    • Library list views now use statusBars.union(displayCutout) with top + horizontal insets to avoid overlap (including landscape side cutouts).
    • App screen back button uses windowInsetsPadding for safe taps; hero image intentionally ignores insets.

Written for commit 82f7360. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of phone notches and display cutouts for better layout compatibility.
    • Fixed back button positioning to remain tappable while allowing content to render full-bleed in notched areas.
  • UI/UX

    • Enhanced padding logic on library screens to properly account for screen insets on both list and detail views.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

📝 Walkthrough

Walkthrough

The changes refine window inset and display cutout handling across the library screen UI. The back button overlay now uses inset-aware positioning based on status bars and display cutouts, the safe padding modifier is refactored to conditionally apply insets based on view state, and a theme attribute is added to configure display cutout window layout behavior.

Changes

Cohort / File(s) Summary
Library Screen UI Insets
app/src/main/java/app/gamenative/ui/screen/library/LibraryAppScreen.kt, app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt
Back button overlay positioning now uses inset-aware padding computed from status bars and display cutouts. Safe padding modifier refactored to apply insets conditionally on list view only, using union of status bar and display cutout insets (top/horizontal sides only).
Theme Configuration
app/src/main/res/values/themes.xml
Added android:windowLayoutInDisplayCutoutMode attribute set to shortEdges for theme configuration of display cutout window layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #242: Modifies the same inset/padding calculation logic in LibraryScreen and LibraryAppScreen for status bar and display cutout handling.
  • #843: Adjusts back-button rendering and visibility in LibraryAppScreen.kt through inset-aware padding and visual enhancements.
  • #1062: Restructures the hero overlay and inset-aware padding handling in LibraryAppScreen.kt's top button area.

Suggested reviewers

  • phobos665

Poem

🐰 A rabbit hops through insets deep,
Where cutouts hide and status bars creep,
Padding adjusted, buttons stay tight,
Screens render smooth, from left to right! 🎨✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main change and intent but lacks the mandatory recording/GIF that the template requires. Multiple checklist items remain unchecked, including discussion in #code-changes and attaching a recording. Attach a recording/GIF demonstrating the notch/cutout-aware layout changes, particularly showing the back button and content positioning on devices with cutouts or notches.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: making app and library screen layouts cutout/notch aware, which is the primary focus of the changeset across all three modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-status-bar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt (1)

467-488: LGTM — list-view inset handling is consistent with the back button.

The statusBars ∪ displayCutout (Top + Horizontal) approach mirrors the back button in LibraryAppScreen.kt, and the selectedLibraryItem == null gate cleanly hands inset responsibility to AppScreenContent on the detail page. Excluding Bottom so scroll content can reach the edge is the right call.

Optional follow-up: with this rewrite, displayCutoutPadding (imported on line 19) appears to no longer be used in this file — worth removing if your linter doesn't already catch it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt` around
lines 467 - 488, Remove the now-unused displayCutoutPadding import from
LibraryScreen.kt (the import referenced around line 19) since
safePaddingModifier no longer uses it; search for and delete the
displayCutoutPadding import and run the linter/compile to ensure no other unused
imports remain and adjust imports if the IDE prompts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/res/values/themes.xml`:
- Line 8: The theme currently sets
android:windowLayoutInDisplayCutoutMode="shortEdges" which requires API 28;
either move that item into the API-28-specific resource file (create or update
values-v28/themes.xml and place the <item
name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> there) or keep
it in this file but add the tools namespace and annotation to the style (add
xmlns:tools="http://schemas.android.com/tools" on the <style> and set
tools:targetApi="28" on the same <style>) so lint knows this attribute targets
API 28+; update the theme element accordingly to reference
android:windowLayoutInDisplayCutoutMode/shortEdges.

---

Nitpick comments:
In `@app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt`:
- Around line 467-488: Remove the now-unused displayCutoutPadding import from
LibraryScreen.kt (the import referenced around line 19) since
safePaddingModifier no longer uses it; search for and delete the
displayCutoutPadding import and run the linter/compile to ensure no other unused
imports remain and adjust imports if the IDE prompts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d1a1953-6845-42af-ab39-abeb41f846ee

📥 Commits

Reviewing files that changed from the base of the PR and between 03d7145 and 82f7360.

📒 Files selected for processing (3)
  • app/src/main/java/app/gamenative/ui/screen/library/LibraryAppScreen.kt
  • app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt
  • app/src/main/res/values/themes.xml

<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find minSdk and check whether values-v28 already exists.
fd -t f -e gradle -e kts | xargs rg -nP '\bminSdk(Version)?\s*[=( ]\s*\d+' 2>/dev/null
echo '---'
fd -t d 'values-v28' app/src/main/res 2>/dev/null

Repository: utkarshdalal/GameNative

Length of output: 164


Move android:windowLayoutInDisplayCutoutMode to API 28+ variant or add tools:targetApi.

The windowLayoutInDisplayCutoutMode attribute (and its shortEdges value) require API 28, but the app's minSdk is 26. This will trigger lint warnings and be silently ignored on older devices. Either move this to values-v28/themes.xml or add xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28" to the <style> element.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/values/themes.xml` at line 8, The theme currently sets
android:windowLayoutInDisplayCutoutMode="shortEdges" which requires API 28;
either move that item into the API-28-specific resource file (create or update
values-v28/themes.xml and place the <item
name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> there) or keep
it in this file but add the tools namespace and annotation to the style (add
xmlns:tools="http://schemas.android.com/tools" on the <style> and set
tools:targetApi="28" on the same <style>) so lint knows this attribute targets
API 28+; update the theme element accordingly to reference
android:windowLayoutInDisplayCutoutMode/shortEdges.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@utkarshdalal utkarshdalal merged commit aada2bf into master Apr 26, 2026
3 checks 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.

1 participant