Made layouts for appscreen and libraryscreen cutout/notch aware#1299
Made layouts for appscreen and libraryscreen cutout/notch aware#1299utkarshdalal merged 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 inLibraryAppScreen.kt, and theselectedLibraryItem == nullgate cleanly hands inset responsibility toAppScreenContenton the detail page. ExcludingBottomso 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
📒 Files selected for processing (3)
app/src/main/java/app/gamenative/ui/screen/library/LibraryAppScreen.ktapp/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.ktapp/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> |
There was a problem hiding this comment.
🧩 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/nullRepository: 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.
Description
made the UI aware of notches
Recording
Type of Change
Checklist
#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.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.
shortEdgesinthemes.xml.statusBars.union(displayCutout)with top + horizontal insets to avoid overlap (including landscape side cutouts).windowInsetsPaddingfor safe taps; hero image intentionally ignores insets.Written for commit 82f7360. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
UI/UX