|
@@ -4,12 +4,12 @@ import os
|
|
import re
|
|
import re
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
|
|
|
-from utils.color_set import get_new_colors, get_old_colors, get_old_dimens
|
|
|
|
|
|
+from colors.utils.color_set import get_new_colors, get_old_colors, get_old_dimens
|
|
|
|
|
|
|
|
|
|
# 需要忽略的文件
|
|
# 需要忽略的文件
|
|
def get_excluded_files():
|
|
def get_excluded_files():
|
|
- return {'colors.xml', 'colors_alpha.xml', 'strings.xml',
|
|
|
|
|
|
+ return {'colors.xml', 'colors_alpha.xml', 'colors_hyif.xml', 'colors_wsy.xml', 'strings.xml',
|
|
'TimeSpendDetailFragment.kt', 'TimeSpendDetailDialog.kt', 'PostTypeHelper.java',
|
|
'TimeSpendDetailFragment.kt', 'TimeSpendDetailDialog.kt', 'PostTypeHelper.java',
|
|
'ProduceDataRecycleViewScrollBar.java', 'DefaultTitleDialog.java', 'GlideUtils.java'}
|
|
'ProduceDataRecycleViewScrollBar.java', 'DefaultTitleDialog.java', 'GlideUtils.java'}
|
|
|
|
|
|
@@ -222,6 +222,9 @@ def replace_old_color(text):
|
|
new_colors = get_new_colors()
|
|
new_colors = get_new_colors()
|
|
old_colors = get_old_colors()
|
|
old_colors = get_old_colors()
|
|
|
|
|
|
|
|
+ text = text.replace("\"#ffffffff\"", "\"#ffffff\"")
|
|
|
|
+ text = text.replace("\"#FFFFFFFF\"", "\"#ffffff\"")
|
|
|
|
+
|
|
for new_color in new_colors:
|
|
for new_color in new_colors:
|
|
new_color_name = new_color[0]
|
|
new_color_name = new_color[0]
|
|
new_color_code = new_color[1]
|
|
new_color_code = new_color[1]
|
|
@@ -237,6 +240,42 @@ def replace_old_color(text):
|
|
# print(f"新旧颜色装换{old_color_name}->{new_color_name}->{new_color_code}")
|
|
# print(f"新旧颜色装换{old_color_name}->{new_color_name}->{new_color_code}")
|
|
text = text.replace(f"@color/{old_color_name}", f"@color/{new_color_name}")
|
|
text = text.replace(f"@color/{old_color_name}", f"@color/{new_color_name}")
|
|
text = text.replace(f"R.color.{old_color_name}", f"R.color.{new_color_name}")
|
|
text = text.replace(f"R.color.{old_color_name}", f"R.color.{new_color_name}")
|
|
|
|
+
|
|
|
|
+ text = text.replace("@android:color/white", "@color/white")
|
|
|
|
+ text = text.replace("@android:color/black", "@color/black")
|
|
|
|
+ text = text.replace("android.R.color.white", "R.color.white")
|
|
|
|
+ text = text.replace("android.R.color.black", "R.color.black")
|
|
|
|
+
|
|
|
|
+ text = text.replace("bg_pressed", "green_brand_8")
|
|
|
|
+ text = text.replace("menu_item_bg_pressed_eb23c268", "green_brand_8")
|
|
|
|
+ text = text.replace("menu_item_bg_pressed", "green_brand_8")
|
|
|
|
+
|
|
|
|
+ # 错误校正,非必须
|
|
|
|
+ text = text.replace("green_brandDark", "green_brand")
|
|
|
|
+ text = text.replace("green_brand_brand", "green_brand")
|
|
|
|
+ text = text.replace("green_brand_brandDark", "green_brand")
|
|
|
|
+ text = text.replace("green_brandDark", "green_brand")
|
|
|
|
+ text = text.replace("green_brand_08", "green_brand_7")
|
|
|
|
+ text = text.replace("green_brand_brand_word", "green_word")
|
|
|
|
+ text = text.replace("green_brand_word", "green_word")
|
|
|
|
+ text = text.replace("green_brand_hover", "green_hover")
|
|
|
|
+ text = text.replace("green_brand_line", "green_line")
|
|
|
|
+ text = text.replace("green_brand_e0fce7", "green_e0fce7")
|
|
|
|
+ text = text.replace("bg_light_00", "transparent")
|
|
|
|
+ text = text.replace("font_color_ff131715", "black_h1")
|
|
|
|
+ text = text.replace("green_brand_bg", "green_bg")
|
|
|
|
+ text = text.replace("color_ff131715", "black_h1")
|
|
|
|
+ text = text.replace("color_green_", "green_brand_")
|
|
|
|
+ text = text.replace("green_brand_8_e623c268", "green_brand_8")
|
|
|
|
+
|
|
|
|
+ # text = text.replace("Color.parseColor(\"#ffffff\")", "ResUtils.getColor(R.color.white)")
|
|
|
|
+ # text = text.replace("Color.parseColor(\"#ffffffff\")", "ResUtils.getColor(R.color.white)")
|
|
|
|
+ # text = text.replace("android:textColor=\"#ffffffff\"", "android:textColor=\"@color/white\"")
|
|
|
|
+ # text = text.replace("android:background=\"#ffffffff\"", "android:background=\"@color/bg_white\"")
|
|
|
|
+ # text = text.replace("setImageDrawable(ContextCompat.getDrawable(mActivity, ", "setImageResource((")
|
|
|
|
+
|
|
|
|
+ text = text.replace("color_333333", "black_h2")
|
|
|
|
+ text = text.replace("color_999999", "black_h4")
|
|
return text
|
|
return text
|
|
|
|
|
|
|
|
|
|
@@ -401,13 +440,18 @@ def replace_system_bar(text):
|
|
return text
|
|
return text
|
|
|
|
|
|
|
|
|
|
-def replace_icon(text):
|
|
|
|
|
|
+def replace_back_icon(text):
|
|
text = text.replace("gamedetail_icon_nav_come_back3", "bar_back")
|
|
text = text.replace("gamedetail_icon_nav_come_back3", "bar_back")
|
|
text = text.replace("icon_back_black", "bar_back")
|
|
text = text.replace("icon_back_black", "bar_back")
|
|
|
|
+ text = text.replace("nav_come_back", "bar_back")
|
|
|
|
+ return text
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def replace_arrow_icon(text):
|
|
text = text.replace("accredit_icon_check", "set_sign_tick")
|
|
text = text.replace("accredit_icon_check", "set_sign_tick")
|
|
text = text.replace("gamedetails_icon_into", "set_icon_arrow")
|
|
text = text.replace("gamedetails_icon_into", "set_icon_arrow")
|
|
text = text.replace("home_icon_arrow_gray2", "set_icon_arrow")
|
|
text = text.replace("home_icon_arrow_gray2", "set_icon_arrow")
|
|
-
|
|
|
|
|
|
+ text = text.replace("cloudgame_icon_arrow_big", "set_icon_arrow")
|
|
text = text.replace("android:drawableRight=\"@drawable/icon_more\"",
|
|
text = text.replace("android:drawableRight=\"@drawable/icon_more\"",
|
|
"app:drawableEndCompat=\"@drawable/set_icon_arrow\"")
|
|
"app:drawableEndCompat=\"@drawable/set_icon_arrow\"")
|
|
text = text.replace("android:src=\"@drawable/icon_more\"",
|
|
text = text.replace("android:src=\"@drawable/icon_more\"",
|
|
@@ -425,4 +469,8 @@ def replace_background(text):
|
|
text = text.replace("app:bl_solid_color=\"#ffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
text = text.replace("app:bl_solid_color=\"#ffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
text = text.replace("app:bl_solid_color=\"#FFFFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
text = text.replace("app:bl_solid_color=\"#FFFFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
text = text.replace("app:bl_solid_color=\"#FFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
text = text.replace("app:bl_solid_color=\"#FFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
|
|
|
|
+ text = text.replace("android:drawable=\"@color/white\"", "android:drawable=\"@color/bg_white\"")
|
|
|
|
+ text = text.replace("android:drawable=\"@android:color/white\"", "android:drawable=\"@color/bg_white\"")
|
|
|
|
+
|
|
|
|
+ text = text.replace("@drawable/bg_default_navigate_click", "?actionBarItemBackground")
|
|
return text
|
|
return text
|