Make settings section separators visible in black theme#7039
Conversation
In the Black (OLED) theme the canvas is forced to pure black while the section-separator divider keeps its standard-dark colour (outlineVariant, ~10% alpha white), leaving dividers in Settings and related screens almost invisible. Add an OLED-aware listSectionDivider alias that lightens the divider only when the black theme is active, and use it for the ListSectionHeader divider. Light and standard-dark themes are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
|
|
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
|
Makes sense to me, but we need some design feedback: @americanrefugee ? @mvanhorn could you attach some screenshots so we can check the result? |
bmarty
left a comment
There was a problem hiding this comment.
I guess we should use a color from our Element theme instead of DividerDefaults.color in fun HorizontalDivider?
I will create a first PR with this |
Use color/separator/primary |
Actually the Divider height was not correct. With 1 instead of 0.5 and color/separator/secondary, this is fine. I have done this in #7054 , you can see the recorded screenshots there. |
|
You can now fix the separator color by setting a color for |
Following review feedback: now that the global HorizontalDivider uses separatorSecondary (element-hq#7054), give the Black/OLED theme a visible separatorSecondary value in ElementTheme instead of carrying a bespoke listSectionDivider alias. This fixes all separators on pure black, not just section headers. The exact color is pending design confirmation.
|
Thanks @bmarty, done. Now that #7054 makes the global I went with |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7039 +/- ##
===========================================
- Coverage 80.58% 80.58% -0.01%
===========================================
Files 2676 2676
Lines 76236 76238 +2
Branches 10251 10251
===========================================
Hits 61436 61436
- Misses 10870 10872 +2
Partials 3930 3930 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@mvanhorn it seems like everything's fine except we need new screenshots to be recorded. Could you do that following the instructions in this automated PR comment? Actually, it looks like you also need to sign the CLA: #7039 (comment) |
| compoundDark.copy(bgCanvasDefault = Color.Black) | ||
| compoundDark.copy( | ||
| bgCanvasDefault = Color.Black, | ||
| // Pending design confirmation from americanrefugee/bmarty. |
There was a problem hiding this comment.
Please remove this comment, so that we can merge the PR. Better to discuss decision in GH issues or PR than in the code.
Also please fix the other points (CLA and screenshots).
Content
Adds an OLED-aware divider color so the
ListSectionHeadersection separators stay visible in the Black (OLED) theme.The Black theme is built in
ElementTheme.ktascompoundDark.copy(bgCanvasDefault = Color.Black)- it forces the canvas to pure black but leaves the divider color at its standard-dark value. The section divider resolves to Material'sDividerDefaults.color(outlineVariant=colorAlphaGray400, ~10% alpha white), which is visible against the standard dark-gray canvas but almost invisible against pure black.This PR introduces a
listSectionDivideralias inColorAliases.ktthat returns a higher-contrast gray (colorAlphaGray700) only when the OLED/Black theme is active (!isLight && bgCanvasDefault == Color.Black), and wires it into theListSectionHeaderdivider. The light and standard-dark themes return the exact samecolorAlphaGray400token they use today, so they are unchanged.Motivation and context
Closes #6852
In the Black (OLED) theme the section separators and
ListSectionHeaderdividers in Settings, Developer options, and Advanced settings became almost invisible, making the screens read as one undifferentiated list. The fix is scoped to the divider alias used by section separators so only the OLED case changes.Screenshots / GIFs
UI change is covered by the existing
ListSectionHeaderWithDividerPreviewComposable preview, so the divider change is visible in the diff and in screenshot tests. The light and standard-dark snapshots are unchanged because their divider color is byte-for-byte identical to before.Tests
ListSectionHeaderdividers render with visible contrast against the pure-black canvas.colorAlphaGray400token as before).hasDivider = falsesection headers still render no divider in all themes.Tested devices
Checklist