Skip to content

Commit 29e594c

Browse files
drchendsn5ft
authored andcommitted
[M3][Dialog] Fix dialog icon color tint
Only tints dialog icons when it's an SVG with colorControlNormal, which is the common default color used by vector icons. PiperOrigin-RevId: 418666657 (cherry picked from commit 246b340)
1 parent 6a914c3 commit 29e594c

File tree

1 file changed

+6
-1
lines changed
  • lib/java/com/google/android/material/dialog/res/values

1 file changed

+6
-1
lines changed

lib/java/com/google/android/material/dialog/res/values/styles.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@
130130
<item name="android:layout_height">@dimen/m3_alert_dialog_icon_size</item>
131131
<item name="android:layout_marginEnd" tools:ignore="NewApi">@dimen/m3_alert_dialog_icon_margin</item>
132132
<item name="android:layout_marginRight">@dimen/m3_alert_dialog_icon_margin</item>
133-
<item name="tint">?attr/colorSecondary</item>
133+
<item name="android:theme">@style/ThemeOverlay.MaterialAlertDialog.Material3.Title.Icon</item>
134+
</style>
135+
136+
<!-- Theme overlay to override icon colors if it's a vector drawable with default colors. -->
137+
<style name="ThemeOverlay.MaterialAlertDialog.Material3.Title.Icon" parent="">
138+
<item name="colorControlNormal">?attr/colorSecondary</item>
134139
</style>
135140

136141
<style name="MaterialAlertDialog.Material3.Title.Icon.CenterStacked">

0 commit comments

Comments
 (0)