Repository navigation
feat: enable edge-to-edge in all :app activities - #246
AndreIsraelAO wants to merge 4 commits into
Conversation
Calls enableEdgeToEdge() in onCreate of the 12 :app activities, makes MainActivity's system bars follow the in-app theme, and pads the templates screen with systemBars insets. Refs Gurupreet#243
dipenpradhan
left a comment
There was a problem hiding this comment.
Thanks for picking this up! I reviewed only the lines this PR changes. Comments are tagged by priority: 🔴 high, 🟠 medium, 🟡 low, ⚪ cleanup.
Suggested order: the shared themed helper (🟠, on AdaptiveUIActivity) also fixes the 🔴 icon-contrast issue, then the nav scrim and Templates padding, then the two MainActivity nits.
⚪ Cleanup (not on a changed line): this PR removes the last caller of SystemUiController, so theme/SystemUI.kt (SystemUiController + LocalSystemUiController, ~130 lines of deprecated systemUiVisibility code) is now dead. It's worth deleting here so nobody calls setStatusBarColor later and overwrites the edge-to-edge bar colours.
|
Hi André, thank you for your contribution! Please take a look at my review comments for this PR. |
Addresses review on Gurupreet#246: shared enableEdgeToEdge(darkTheme) helper with default nav scrims, applied in all activities; MainActivity applies it up front and on theme change; Templates padding moved inside the Surface; delete the now-unused SystemUiController.
|
Hi @dipenpradhan, thanks for the review! All the earlier comments are addressed in 2b9ef2e (shared The latest "Changes requested" review came without any text or inline comment on my side. Could you let me know what is still missing? Also, the 4 workflows ( |
dipenpradhan
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround! I checked the update against the code, and all 7 points from my previous review are addressed:
- every activity passes its in-app theme through the shared helper
- the nav scrims match the androidx defaults
- the Templates background now fills the screen
- the bar style is set in
onCreate, with noDisposableEffectand no context cast SystemUI.ktis removed
A few smaller follow-ups are inline (🟠 medium, 🟡 low). Two more don't map to a changed line:
🟡 PR description is out of date after 2b9ef2e.
- It still says MainActivity uses a
DisposableEffectand thatBaseViewdropped an unusedsystemUiControllerparam (it was used). - It doesn't mention
theme/EdgeToEdge.ktor the deletion ofSystemUI.kt. - The Risks bullet "Other activities use the system-follow bar style" no longer applies, and
:apphas no Roborazzi baselines to re-record. - How to test only mentions an API 35+ emulator, but edge-to-edge was already enforced there by targetSdk 35. The behaviour this PR changes is on API 25–34. It'd be worth testing on an API 29–34 emulator with 3-button nav, and toggling the in-app dark theme opposite to the OS theme.
🟡 Stale comment: demos/tiktok/.../TiktokActivity.kt:40 still says "We can also use SystemUiController(window)…", which now points at a deleted class.
Rename helper to enableThemedEdgeToEdge, include display cutout in the Templates padding, apply the style with SideEffect, use the default TopAppBar colours on Widgets so status bar icons stay legible, and drop a stale SystemUiController comment in the TikTok demo.
dipenpradhan
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround, André! The SideEffect, the Templates cutout padding, the Widgets top bar and the TikTok comment all look right, and the description now matches the code.
One blocker, inline: the rename to enableThemedEdgeToEdge reached the call sites but not the helper itself, so the build breaks. CI didn't flag it because the workflow runs on this branch are waiting for maintainer approval.
🟡 Low: test plan skips the API levels the scrim fix is for. "How to test" covers API 29–34 and 35+, but the nav-bar scrims only matter below API 29, and minSdk is 25. Please add an API 26 or 28 emulator with 3-button navigation.
🟡 Low: Widgets top bar no longer shows the palette colour. Dropping the primaryContainer colours fixes icon legibility as intended, but it's also a visual change to the Widgets showcase. A before/after screenshot in the description would help sign off on it.
Once the helper is renamed and CI passes, I don't see anything else blocking.
Part of #243 (PR 1,
:appactivities only; demo modules, IME and accessibility passes are left for follow-ups, so this does not close the issue).Problem
On Android 15+ edge-to-edge is enforced, and none of the
:appactivities opted in or handled insets. Calling the bareenableEdgeToEdge()would also make the system bar icons follow the OS theme instead of the in-app theme.Solution
theme/EdgeToEdge.ktwithComponentActivity.enableThemedEdgeToEdge(darkTheme): transparent status bar, androidx default nav scrims (needed below API 29), icons following the in-app theme. All 12:appactivities call it inonCreate()with their own dark-theme flag.MainActivity: applies the initial style inonCreateand re-applies it from aSideEffectwhen the in-app theme changes.BaseViewis a plain theme composable again (itssystemUiControllerparam, which set the status bar colour, is gone).theme/SystemUI.kt(SystemUiController, no longer used) and a stale comment referencing it in the TikTok demo.TemplatesActivity: dropFLAG_TRANSLUCENT_STATUS;Surface(fillMaxSize)with an innerBoxpadded by system bars + display cutout.WidgetScreen: use the defaultTopAppBarcolours so the transparent status bar sits over a surface colour and the icons stay legible regardless of palette.How to test
Run
:app:installDebugon an API 26 or 28 emulator (3-button nav, where the nav scrims matter) and on API 29-34 emulators (3-button and gesture nav) and API 35+. Open Home, Widgets, Lists and the templates, and toggle the in-app dark theme opposite to the OS theme: status and nav bar icons must stay legible and nothing is clipped behind the bars. Rotate with a side cutout if available.Visual change
The Widgets top bar now uses the default surface colours instead of
primaryContainer(palette colour), so the transparent status bar keeps legible icons. No before/after screenshots yet: I could not run the app locally.Risks
ktfmtCheckpasses, but I could not compile or run on a device (no Android SDK locally).