|
@@ -87,20 +87,26 @@ class DialogInit {
|
|
|
if (!builder.titleColorSet) {
|
|
|
final int titleColorFallback = DialogUtils.resolveColor(builder.context, android.R.attr.textColorPrimary);
|
|
|
builder.titleColor = DialogUtils.resolveColor(builder.context, R.attr.md_title_color, titleColorFallback);
|
|
|
- if (DialogUtils.isColorDark(builder.titleColor)) {
|
|
|
- if (builder.theme == Theme.DARK)
|
|
|
+ if (builder.titleColor == titleColorFallback) {
|
|
|
+ // Only check for light/dark if color wasn't set to md_title_color
|
|
|
+ if (DialogUtils.isColorDark(builder.titleColor)) {
|
|
|
+ if (builder.theme == Theme.DARK)
|
|
|
+ builder.titleColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorPrimaryInverse);
|
|
|
+ } else if (builder.theme == Theme.LIGHT)
|
|
|
builder.titleColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorPrimaryInverse);
|
|
|
- } else if (builder.theme == Theme.LIGHT)
|
|
|
- builder.titleColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorPrimaryInverse);
|
|
|
+ }
|
|
|
}
|
|
|
if (!builder.contentColorSet) {
|
|
|
final int contentColorFallback = DialogUtils.resolveColor(builder.context, android.R.attr.textColorSecondary);
|
|
|
builder.contentColor = DialogUtils.resolveColor(builder.context, R.attr.md_content_color, contentColorFallback);
|
|
|
- if (DialogUtils.isColorDark(builder.contentColor)) {
|
|
|
- if (builder.theme == Theme.DARK)
|
|
|
+ if (builder.contentColor == contentColorFallback) {
|
|
|
+ // Only check for light/dark if color wasn't set to md_content_color
|
|
|
+ if (DialogUtils.isColorDark(builder.contentColor)) {
|
|
|
+ if (builder.theme == Theme.DARK)
|
|
|
+ builder.contentColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorSecondaryInverse);
|
|
|
+ } else if (builder.theme == Theme.LIGHT)
|
|
|
builder.contentColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorSecondaryInverse);
|
|
|
- } else if (builder.theme == Theme.LIGHT)
|
|
|
- builder.contentColor = DialogUtils.resolveColor(builder.context, android.R.attr.textColorSecondaryInverse);
|
|
|
+ }
|
|
|
}
|
|
|
if (!builder.itemColorSet)
|
|
|
builder.itemColor = DialogUtils.resolveColor(builder.context, R.attr.md_item_color, builder.contentColor);
|