Closed Bug 1217416 Opened 4 years ago Closed 4 years ago
.3/4 .x: Text color of Snackbar is changed by theme
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".
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.
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+
https://hg.mozilla.org/integration/fx-team/rev/a6eb8032ebf668d7baa2637190aadb39ed2a810e Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret
This appears to have broken B2GDroid builds: https://treeherder.mozilla.org/logviewer.html#?job_id=5307224&repo=fx-team Backed out in https://hg.mozilla.org/integration/fx-team/rev/eb835b982e8a
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.
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/integration/fx-team/rev/22130b849ebb629bda85fbf7111a428c7d1f4d8a Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret
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.