Repository navigation
fix(ui): use the full window width next to a display cutout on the short edge - #6809
ToteMeiSter wants to merge 2 commits into
Conversation
…ort edge With windowLayoutInDisplayCutoutMode=default (AppTheme), the system moves the whole window away from a cutout that is not inside the status bar. On a foldable with a camera hole on the short edge of the inner screen this leaves a black bar in landscape, so the chat and the conversation list do not use the full width. Chat and conversation list use AppTheme.DisplayCutout (shortEdges, API 28+) and pad their content by the left and right cutout inset below API 35. Assisted-by: Claude-Code:claude-opus-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe chat and conversation list activities now use a theme that enables layout into short-edge display cutouts. New extensions apply horizontal cutout inset padding below API 35. ChatActivity calls the activity extension after setting its content view. Robolectric tests cover right-side cutout padding and padding updates when the cutout moves to the left. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The cutout change has no established merge-blocking issue; it is ready for normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)
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
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1dfb1f3e-12b2-415f-a426-3b1e5180d656
📒 Files selected for processing (7)
app/src/main/AndroidManifest.xmlapp/src/main/java/com/nextcloud/talk/chat/ChatActivity.ktapp/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.ktapp/src/main/java/com/nextcloud/talk/utils/AppCompatActivityExtensions.ktapp/src/main/res/values-v28/styles.xmlapp/src/main/res/values/styles.xmlapp/src/test/java/com/nextcloud/talk/utils/DisplayCutoutPaddingTest.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
|
Hi @ToteMeiSter thank you for your contributions. |
The conversation list is a Compose screen whose Scaffold and top bar already keep out of the display cutout by WindowInsets.safeDrawing. Padding android.R.id.content by the cutout as well narrowed the list beyond the cutout-safe area on API 28 to 34. The padding stays for the view based chat. Assisted-by: Claude-Code:claude-opus-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
|
This is a bug fix and all CodeRabbit review threads are resolved. Once it is approved and merged, would it be possible to backport it to Suggested command for a maintainer after merge: This comment was drafted with AI assistance (Claude Code). |
|
Re-checked on the device after the review fix e3bcfb8 (Huawei DEL-LX9, Drafted with AI assistance (Claude Code). |
On a foldable with a camera hole on the inner screen, the chat and the conversation list show a black bar along the cutout edge after the device is rotated to landscape. The bar has the width of the cutout and spans the full height. In portrait there is no bar. The current release from the store shows the same bar on this device.
Cause
ChatActivityandConversationsListActivityuseAppTheme.AppThemeand its parents do not setwindowLayoutInDisplayCutoutMode, so the window uses thedefaultmode. OnlyFullScreenImageThemeandImagePickerTheme.NonFullScreensetshortEdges(res/values-v27/styles.xml).adjustUIForAPILevel35) and the insets listener inChatActivityare only active on API 35 and higher.defaultmode the window is then kept out of the cutout area, which leaves the black bar.Fix
AppTheme.DisplayCutout: empty invalues/styles.xml,windowLayoutInDisplayCutoutMode=shortEdgesinvalues-v28/styles.xml. OnlyChatActivityandConversationsListActivityuse it.keepContentOutOfDisplayCutout()(AppCompatActivityExtensions.kt): below API 35 it adds the left and right cutout insets to the padding ofandroid.R.id.content, so the content does not go under the camera. If there is no cutout on a side, the inset is 0. From API 35 the existing edge-to-edge handling applies and the function does nothing.AppThemeare not changed.Tests
DisplayCutoutPaddingTest(API 31, 2 tests): the left/right cutout inset goes into the padding, the top padding is not changed, and a cutout that moves to the other side updates the padding. Without the inset handling both tests fail.Build.VERSION.SDK_INT= 31), landscape on the inner screen: the black bar is gone.🖼️ Screenshots
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)
The analysis, the code, the test and this description were made with Claude Code (
Assisted-bytrailer in the commit) and reviewed by the author. The fix was verified by the author on the device above.🤖 Generated with Claude Code