Material-dialogs: Styles attributes for title and text color

Created on 13 Sep 2018  路  6Comments  路  Source: afollestad/material-dialogs

([x] becomes a filled in checkbox, [ ] is an empty one)


Include the following:
  • Material Dialogs version: 2.0.0-alpha09
  • Affected device: All

Also, please wrap your code with correct syntax highlighting (not just indents).

MaterialDialog(this)
                        .title(R.string.attention)
                        .message(R.string.choose_screen)
                        .positiveButton(android.R.string.ok)
                        .show()
<item name="android:textColorPrimary">@color/black</item>
<item name="android:textColorSecondary">@color/white</item>

Reproduction Steps

Obsolete, happens always


Expected Result

Text should be a darker color


Actual Result

Text is either white or transparent

This happens with all dialogs we implemented, and we just can't figure out why. We checked all styles, colors and Kotlin files for wrong configurations, but all seems to be fine.

improvement

Most helpful comment

That was actually the cause. When testing, we missed changing the v23+ styles. However, removing that style would affect many other elements in the app. Do you think custom text colors could be something for a future release?

All 6 comments

The text color is set in styles here: https://github.com/afollestad/material-dialogs/blob/b571da41183cb57420a48592669f514296befc66/core/src/main/res/values/styles.xml#L50


Which is taking ?android:textColorSecondary from the dialog's base theme (would be Theme.AppCompat.Light.Dialog.Alert). This shouldn't be possible 馃 have you tried it on other devices?

Tested on 4 devices and various different emulators. Let me know if you need more info!

I can't reproduce on my Pixel 2 XL or emulators, at least not with the sample project.

There must be something in Screener affecting it somehow 馃

You have <item name="android:textColorSecondary">@color/white</item> above, is that in your Activity theme?

That was actually the cause. When testing, we missed changing the v23+ styles. However, removing that style would affect many other elements in the app. Do you think custom text colors could be something for a future release?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlelse picture jlelse  路  6Comments

ghost picture ghost  路  4Comments

dabo248 picture dabo248  路  7Comments

enricocid picture enricocid  路  4Comments

imcloud picture imcloud  路  5Comments