Closed Bug 1217416 Opened 4 years ago Closed 4 years ago

Android 2.3/4.x: Text color of Snackbar is changed by theme

Categories

(Firefox for Android :: Theme and Visual Design, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- verified

People

(Reporter: sebastian, Assigned: sebastian)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached image IMG_20151022_155232.jpg
This keeps me from landing the Snackbar patches.

See attached screenshot: On Gingerbread devices the text color of the Snackbar is black. I assume that we somewhere in our theme enforce a dark text color for all texts or something like that. This is not happening on Android 5 and 6.
Summary: Gingerbread: Text color of Snackbar is changed by Ttheme → Gingerbread: Text color of Snackbar is changed by theme
Android 4 devices seem to be affected too.
Summary: Gingerbread: Text color of Snackbar is changed by theme → Android 2.3/4.x: Text color of Snackbar is changed by theme
The snackbar gets its text color from "android:textColorPrimary" -> "@color/primary_text" -> "@color/placeholder_active_grey" -> "#222222". For example the same chain of styles defines the text color of the items in the overflow menu.

I don't know why this is not happening on Android 5+ though because the exactly same style chain is used there as well. However it does not affect the snackbar text color.
This is the style the Snackbar uses:
https://chromium.googlesource.com/android_tools/+/HEAD/sdk/extras/android/support/design/res/values/styles.xml#85

The text color is hard coded to "?android:textColorPrimary".
Attached patch 1217416-snackbar-style.patch (obsolete) — Splinter Review
This patch overrides the Snackbar.Message style. In addition to that it sets the action text color to fennec_ui_orange (after talking to Anthony).

I hope after unifying the theme we will not need this anymore.
Attachment #8677595 - Flags: review?(michael.l.comella)
Comment on attachment 8677595 [details] [diff] [review]
1217416-snackbar-style.patch

Adding margaret: Maybe I can land this along with the other Snackbar patches sooner. :)
Attachment #8677595 - Flags: review?(margaret.leibovic)
Attachment #8677595 - Flags: review?(margaret.leibovic) → review+
Attachment #8677595 - Flags: review?(michael.l.comella)
B2G does not use the Android Design Support library (yet). Therefore I can't reference "design_snackbar_text_size" there. I should be able to work around this by overriding all values in the style.
Flags: needinfo?(s.kaspari)
Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret
Attachment #8678729 - Flags: review?(margaret.leibovic)
Attachment #8677595 - Attachment is obsolete: true
Attachment #8678729 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8678729 [details]
MozReview Request: Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret

https://reviewboard.mozilla.org/r/23219/#review20717

::: mobile/android/base/resources/values/styles.xml:297
(Diff revision 1)
> +        <item name="android:textSize">14sp</item>

You could add a comment explaining where this size comes from, and how it would be better to reference design_snackbar_text_size if we could.
https://hg.mozilla.org/mozilla-central/rev/22130b849ebb
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Text color of the Snackbar is white, so:
Verified as fixed using:
Build: Firefox 44.0a1 (2015-10-28)
Device: Samsung S5 (Android 4.4.2) and HTC Desire HD (Android 2.3.5)
You need to log in before you can comment on or make changes to this bug.