Skip to content

Commit 3b5ac1b

Browse files
committed
fix colorStateListUtils using a wrong way when replacing color
1 parent b675fad commit 3b5ac1b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

magicasakura/src/main/java/com/bilibili/magicasakura/utils/ColorStateListUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ static ColorStateList createColorStateList(Context context, int resId) {
4747
ColorStateList cl = null;
4848
if (value.type >= TypedValue.TYPE_FIRST_COLOR_INT
4949
&& value.type <= TypedValue.TYPE_LAST_COLOR_INT) {
50+
//Assume that "color/theme_color_primary" and "color/theme_color_profile" have the same color value;
51+
//However, "color/theme_color_primary" need to replace by themeId, "color/theme_color_profile" not.
52+
//If use value.data may cause "color/theme_color_profile" still been replaced by themeId
5053
cl = ColorStateList.valueOf(ThemeUtils.replaceColorById(context, value.resourceId));
5154
} else {
5255
final String file = value.string.toString();

0 commit comments

Comments
 (0)