other_utils.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. #!/usr/bin/python
  2. # -*- coding: UTF-8 -*-
  3. import os
  4. import re
  5. from pathlib import Path
  6. from utils.color_set import get_new_colors, get_old_colors, get_old_dimens
  7. # 需要忽略的文件
  8. def get_excluded_files():
  9. return {'colors.xml', 'colors_alpha.xml', 'colors_wsy.xml', 'colors_yj.xml', 'colors_qpt.xml', 'colors_mhh.xml',
  10. 'colors_cph.xml', 'colors_lyg.xml', 'colors_hyif.xml', 'colors_wsy.xml', 'strings.xml'}
  11. # 需要忽略的文件夹
  12. def get_excluded_dirs():
  13. return ['.git', '.svn', 'build', '.gradle', '.idea', 'test', 'androidTest']
  14. # 需要处理的文件后缀
  15. def get_included_suffix():
  16. return ['.xml', '.java', '.kt']
  17. # 统一路径分隔符
  18. def unify_path_separator(path: str):
  19. path = path.replace("\\", os.path.sep)
  20. path = path.replace("/", os.path.sep)
  21. return path
  22. def update_colors_resource_file(colors_xml_path: str, color_codes):
  23. with open(colors_xml_path, 'r', encoding='utf-8') as f:
  24. text = f.read()
  25. new_colors = set()
  26. for color_code in color_codes:
  27. color_name = get_color_name(color_code)
  28. if color_name.lower() not in text and color_name.upper() not in text:
  29. new_colors.add(f' <color name="{color_name}">{color_code.lower()}</color>')
  30. if new_colors:
  31. new_contents = text.replace('</resources>', '\n'.join(new_colors) + '\n</resources>')
  32. with open(colors_xml_path, 'w', encoding='utf-8') as f:
  33. f.write(new_contents)
  34. # 提取指定文件中的颜色值
  35. def extract_color_codes_from_file(file_path: str):
  36. with open(file_path, 'r', encoding='utf-8') as f:
  37. text = f.read()
  38. color_codes = set(re.findall(r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})', text))
  39. return color_codes
  40. # 根据颜色值获取颜色名称
  41. def get_color_name(color_code):
  42. name = f'color_{color_code.lower()}'
  43. name = name.replace("#", "")
  44. return name.lower()
  45. # 根据颜色值获取颜色名称
  46. def get_file_suffix(file_path: str):
  47. if not os.path.isfile(file_path):
  48. print(f"{file_path} 不是一个文件")
  49. return ""
  50. return Path(file_path).suffix
  51. # 提取指定文件中的颜色值
  52. def extract_codes_colors(text, suffix):
  53. # 提取所有颜色
  54. color_codes = set(re.findall(r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})', text))
  55. if color_codes:
  56. # print(f"提取的颜色:{color_codes}")
  57. if suffix == ".java" or suffix == ".kt":
  58. # pattern = r'Color.parseColor(#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})' # 匹配模式
  59. pattern = r"(Color\.parseColor\s*\(\s*\"#[0-9A-Fa-f]+\s*\"\s*\))" # 匹配模式
  60. matches = re.findall(pattern, text)
  61. if matches:
  62. for match in matches:
  63. color_code = re.search(r'"#([0-9A-Fa-f]+)"', match).group(1)
  64. color_name = get_color_name(color_code)
  65. replacement = "ResUtils.getColor(R.color.{})".format(color_name) # 替换的文本
  66. text = text.replace(match, replacement) # 替换
  67. if suffix == ".java":
  68. if "import com.xmcy.hykb.utils.ResUtils;" not in text:
  69. text = text.replace("import android.graphics.Color;",
  70. "import android.graphics.Color;\nimport com.xmcy.hykb.utils.ResUtils;")
  71. if suffix == ".kt":
  72. if "import com.xmcy.hykb.utils.ResUtils" not in text:
  73. text = text.replace("import android.graphics.Color",
  74. "import android.graphics.Color\nimport com.xmcy.hykb.utils.ResUtils")
  75. elif suffix == ".xml":
  76. pattern = r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})' # 匹配模式
  77. result = re.findall(pattern, text)
  78. if result:
  79. for color_code in result:
  80. color_name = get_color_name(color_code)
  81. replacement = r'@color/{}'.format(color_name) # 替换的文本
  82. text = text.replace(color_code, replacement) # 替换
  83. return text
  84. # 修改主题
  85. def update_base_class(text):
  86. pattern = r'#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6})' # 匹配模式
  87. result = re.findall(pattern, text)
  88. if result:
  89. for color_code in result:
  90. color_name = get_color_name(color_code)
  91. replacement = r'@color/{}'.format(color_name) # 替换的文本
  92. text = text.replace(color_code, replacement) # 替换
  93. return text
  94. # 修改过时方法
  95. def update_deprecated(text):
  96. text = text.replace("DensityUtils.dp2px(mContext,", "DensityUtils.dp2px(")
  97. text = text.replace("DensityUtils.dp2px(mActivity,", "DensityUtils.dp2px(")
  98. text = text.replace("DensityUtils.dp2px(context,", "DensityUtils.dp2px(")
  99. text = text.replace("DensityUtils.dp2px(activity,", "DensityUtils.dp2px(")
  100. text = text.replace("DensityUtils.dp2px(getActivity(),", "DensityUtils.dp2px(")
  101. text = text.replace("DensityUtils.dp2px(HYKBApplication.getContext(), ", "DensityUtils.dp2px(")
  102. text = text.replace("DensityUtils.dp2px(getContext(),", "DensityUtils.dp2px(")
  103. # text = text.replace("setBackgroundDrawable", "setBackground")
  104. text = text.replace("setBackground(context.getResources().getDrawable(R.", "setBackgroundResource((R.")
  105. text = text.replace(r'\(\(R\.drawable\.[^\)]+\)\)', r'\(R\.drawable\.[^\)]+\)')
  106. return text
  107. # 修改主题
  108. def update_themes(text):
  109. text = text.replace("\"android:style/Theme.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
  110. text = text.replace("\"@android:style/Theme.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
  111. text = text.replace("\"@android:style/Theme.Holo.Dialog\"", "\"@style/Theme.Material3.DayNight.Dialog\"")
  112. text = text.replace("ThemeOverlay.AppCompat.Light", "Theme.Material3.DayNight")
  113. text = text.replace("Theme.AppCompat.NoActionBar", "Theme.Material3.DayNight.NoActionBar")
  114. text = text.replace("Theme.AppCompat.Light", "Theme.Material3.DayNight")
  115. text = text.replace("Theme.AppCompat", "Theme.Material3.DayNight")
  116. text = text.replace("\"Theme.Material3.DayNight", "\"@style/Theme.Material3.DayNight")
  117. text = text.replace("<item name=\"android:windowBackground\">@color/white</item>",
  118. "<item name=\"android:windowBackground\">@color/bg_white</item>")
  119. return text
  120. # 匹配两行或更多连续的空白行,并将它们替换为一行空白行
  121. def delete_java_blank_line(text):
  122. text = re.sub("\n\s+\n+", "\n\n", text)
  123. return text
  124. # 删除xml多余空白行
  125. def delete_xml_blank_line(text, suffix):
  126. if suffix == ".xml":
  127. text = re.sub("\n\s+\n+", "\n\n", text)
  128. return text
  129. # 添加R文件引入
  130. def add_import_R(text, suffix):
  131. if suffix == ".java":
  132. if "import android.graphics.Color;" in text:
  133. if "package com.xmcy.hykb.app" in text and "import com.xmcy.hykb.R;" not in text:
  134. text = text.replace("import android.graphics.Color;",
  135. "import android.graphics.Color;\nimport com.xmcy.hykb.R;")
  136. if "import androidx.core.content.ContextCompat;" not in text:
  137. text = text.replace("import android.graphics.Color;",
  138. "import android.graphics.Color;\nimport androidx.core.content.ContextCompat;")
  139. elif suffix == ".kt":
  140. if "import android.graphics.Color" in text:
  141. if "package com.xmcy.hykb.app" in text and "import com.xmcy.hykb.R" not in text:
  142. text = text.replace("import android.graphics.Color",
  143. "import android.graphics.Color\nimport com.xmcy.hykb.R")
  144. if "import androidx.core.content.ContextCompat" not in text:
  145. text = text.replace("import android.graphics.Color",
  146. "import android.graphics.Color\nimport androidx.core.content.ContextCompat")
  147. return text
  148. # 添加头信息
  149. def add_xml_res_auto(text):
  150. if "xmlns:app=\"http://schemas.android.com/apk/res-auto\"" not in text and "app:" in text:
  151. text = text.replace("xmlns:android=\"http://schemas.android.com/apk/res/android\"",
  152. "xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"")
  153. return text
  154. # 删除xml注释
  155. def delete_xml_remark(text):
  156. matches = re.findall(r"<!-[\s\S]*?-->", text)
  157. if matches:
  158. for match in matches:
  159. text = text.replace(match + "\n", "")
  160. text = text.replace(match, "")
  161. return text
  162. # 替换旧的dimen
  163. def hykb_dimens(text):
  164. dimens = get_old_dimens()
  165. text = text.replace("@dimen/post_detail_item_bottom_12dp", "12dp")
  166. for dimen in dimens:
  167. key = dimen[0]
  168. value = dimen[1]
  169. text = text.replace(f"@dimen/{key}", f"{value}")
  170. text = text.replace(f"@dimen/{key}", f"{value}")
  171. return text
  172. # 替换旧的颜色
  173. def replace_old_color(text):
  174. new_colors = get_new_colors()
  175. old_colors = get_old_colors()
  176. text = text.replace("\"#ffffffff\"", "\"#ffffff\"")
  177. text = text.replace("\"#FFFFFFFF\"", "\"#ffffff\"")
  178. for new_color in new_colors:
  179. new_color_name = new_color[0]
  180. new_color_code = new_color[1]
  181. for old_color in old_colors:
  182. old_color_name = old_color[0]
  183. old_color_code = old_color[1]
  184. if len(old_color_code) == 8 and old_color_code.startswith("00"):
  185. print(f"发现透明颜色:{old_color_name}->{old_color_code}")
  186. text = text.replace(f"@color/{old_color_name}", f"@color/transparent")
  187. text = text.replace(f"R.color.{old_color_name}", f"R.color.transparent")
  188. elif old_color_code.lower() == new_color_code.lower():
  189. # print(f"新旧颜色装换{old_color_name}->{new_color_name}->{new_color_code}")
  190. text = text.replace(f"@color/{old_color_name}", f"@color/{new_color_name}")
  191. text = text.replace(f"R.color.{old_color_name}", f"R.color.{new_color_name}")
  192. text = text.replace("@android:color/white", "@color/white")
  193. text = text.replace("@android:color/black", "@color/black")
  194. text = text.replace("android.R.color.white", "R.color.white")
  195. text = text.replace("android.R.color.black", "R.color.black")
  196. text = text.replace("bg_pressed", "green_brand_8")
  197. text = text.replace("menu_item_bg_pressed_eb23c268", "green_brand_8")
  198. text = text.replace("menu_item_bg_pressed", "green_brand_8")
  199. # 错误校正,非必须
  200. text = text.replace("green_brandDark", "green_brand")
  201. text = text.replace("green_brand_brand", "green_brand")
  202. text = text.replace("green_brand_brandDark", "green_brand")
  203. text = text.replace("green_brandDark", "green_brand")
  204. text = text.replace("green_brand_08", "green_brand_7")
  205. text = text.replace("green_brand_brand_word", "green_word")
  206. text = text.replace("green_brand_word", "green_word")
  207. text = text.replace("green_brand_hover", "green_hover")
  208. text = text.replace("green_brand_line", "green_line")
  209. text = text.replace("green_brand_e0fce7", "green_e0fce7")
  210. text = text.replace("bg_light_00", "transparent")
  211. text = text.replace("font_color_ff131715", "black_h1")
  212. text = text.replace("green_brand_bg", "green_bg")
  213. text = text.replace("color_ff131715", "black_h1")
  214. text = text.replace("color_green_", "green_brand_")
  215. text = text.replace("green_brand_8_e623c268", "green_brand_8")
  216. # text = text.replace("Color.parseColor(\"#ffffff\")", "ResUtils.getColor(R.color.white)")
  217. # text = text.replace("Color.parseColor(\"#ffffffff\")", "ResUtils.getColor(R.color.white)")
  218. # text = text.replace("android:textColor=\"#ffffffff\"", "android:textColor=\"@color/white\"")
  219. # text = text.replace("android:background=\"#ffffffff\"", "android:background=\"@color/bg_white\"")
  220. # text = text.replace("setImageDrawable(ContextCompat.getDrawable(mActivity, ", "setImageResource((")
  221. text = text.replace("color_333333", "black_h2")
  222. text = text.replace("color_999999", "black_h4")
  223. return text
  224. # 替换旧方法
  225. def replace_res_utils(text, suffix):
  226. if "import androidx.core.content.ContextCompat\"" not in text and (
  227. "ResUtils.getColor(" in text or "ResUtils.getDrawable(" in text):
  228. if suffix == ".java":
  229. text = text.replace("import com.xmcy.hykb.utils.ResUtils;",
  230. "import com.xmcy.hykb.utils.ResUtils;\nimport androidx.core.content.ContextCompat;")
  231. elif suffix == ".kt":
  232. text = text.replace("import com.xmcy.hykb.utils.ResUtils",
  233. "import com.xmcy.hykb.utils.ResUtils\nimport androidx.core.content.ContextCompat")
  234. matches = re.findall(r'extends\s+\w+Activity', text)
  235. if matches:
  236. text = text.replace("ResUtils.getColor(", "getColorResId(")
  237. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(this, ")
  238. matches = re.findall(r'extends\s+\w+Fragment', text)
  239. if matches:
  240. text = text.replace("ResUtils.getColor(", "getColor(")
  241. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(getContext(), ")
  242. matches = re.findall(r'extends\s+\w+PopupWindow', text)
  243. if matches:
  244. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
  245. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
  246. matches = re.findall(r'extends\s+\w+RecyclerView.Adapter', text)
  247. if matches:
  248. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(viewHolder.itemView.getContext(), ")
  249. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(viewHolder.itemView.getContext(), ")
  250. matches = re.findall(r'extends\s+\w+BaseRecyclerViewBindAdapter', text)
  251. if matches:
  252. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
  253. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
  254. matches = re.findall(r'extends\s+\w+BaseMultipleAdapter', text)
  255. if matches:
  256. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(activity, ")
  257. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(activity, ")
  258. if suffix == ".java":
  259. if "Activity mActivity" in text:
  260. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(mActivity, ")
  261. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(mActivity, ")
  262. elif "Context mContext" in text:
  263. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(mContext, ")
  264. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(mContext, ")
  265. else:
  266. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(getContext(), ")
  267. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(getContext(), ")
  268. elif suffix == ".kt":
  269. text = text.replace("ResUtils.getColor(", "ContextCompat.getColor(context, ")
  270. text = text.replace("ResUtils.getDrawable(", "ContextCompat.getDrawable(context, ")
  271. if ("ResUtils.getString(" not in text
  272. and "ResUtils.getDimension(" not in text
  273. and "ResUtils.getDimensionPixelOffset(" not in text
  274. and "ResUtils.getDimensionPixelSize(" not in text
  275. and "ResUtils.getContextResource(" not in text):
  276. text = text.replace("import com.xmcy.hykb.utils.ResUtils;", "")
  277. return text
  278. def BaseTextOneLineStyle(text):
  279. if "style=\"@style/BaseTextOneLineStyle\"" in text:
  280. print(f"发现:BaseTextOneLineStyle")
  281. text = text.replace("style=\"@style/BaseTextOneLineStyle\"",
  282. "android:includeFontPadding=\"false\" android:singleLine=\"true\" android:ellipsize=\"end\"")
  283. return text
  284. def MoreButtonStyle(text):
  285. if "style=\"@style/MoreButtonStyle\"" in text:
  286. print(f"发现:MoreButtonStyle")
  287. text = text.replace("style=\"@style/MoreButtonStyle\"",
  288. "android:text=\"@string/more\"\n" +
  289. " android:drawableRight=\"@drawable/home_icon_title_arrow\"\n" +
  290. " android:textColor=\"@color/black_h3\"\n" +
  291. " android:textSize=\"12sp\"\n" +
  292. " android:layout_width=\"wrap_content\"\n" +
  293. " android:layout_height=\"24dp\"\n" +
  294. " android:gravity=\"center\"\n" +
  295. " android:background=\"@drawable/bg_more_button_20\"\n" +
  296. " android:paddingLeft=\"8dp\"\n" +
  297. " android:paddingRight=\"8dp\"")
  298. return text
  299. def bg_white_radius10(text):
  300. if "android:background=\"@drawable/bg_white_radius10\"" in text:
  301. print(f"发现:bg_white_radius10")
  302. text = text.replace("android:background=\"@drawable/bg_white_radius10\"",
  303. "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
  304. return text
  305. def bg_homeindex_item_10(text):
  306. if "android:background=\"@drawable/bg_homeindex_item_10\"" in text:
  307. print(f"发现:bg_homeindex_item_10")
  308. text = text.replace("android:background=\"@drawable/bg_homeindex_item_10\"",
  309. "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
  310. return text
  311. def bg_btn_ffffff_10dp(text):
  312. if "android:background=\"@drawable/bg_btn_ffffff_10dp\"" in text:
  313. print(f"发现:bg_white_radius10")
  314. text = text.replace("android:background=\"@drawable/bg_btn_ffffff_10dp\"",
  315. "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_radius=\"10dp\"")
  316. return text
  317. def bg_btn_white_topr10(text):
  318. if "android:background=\"@drawable/bg_btn_white_topr10\"" in text:
  319. print(f"发现:bg_btn_white_topr10")
  320. text = text.replace("android:background=\"@drawable/bg_btn_white_topr10\"",
  321. "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_topRadius=\"10dp\"")
  322. return text
  323. def bg_btn_white_topr12(text):
  324. if "android:background=\"@drawable/bg_btn_white_topr12\"" in text:
  325. print(f"发现:bg_btn_white_topr12")
  326. text = text.replace("android:background=\"@drawable/bg_btn_white_topr12\"",
  327. "app:bl_solid_color=\"@color/bg_white\"\n app:bl_corners_topRadius=\"12dp\"")
  328. return text
  329. def bg_btn_white_topr16(text):
  330. if "android:background=\"@drawable/bg_btn_white_topr16\"" in text:
  331. print(f"发现:bg_btn_white_topr16")
  332. text = text.replace("android:background=\"@drawable/bg_btn_white_topr16\"",
  333. "app:bl_solid_color=\"@color/bg_white\" app:bl_corners_topRadius=\"16dp\"")
  334. return text
  335. def replace_xml_imageview(text):
  336. if "<ImageView\n" in text:
  337. text = text.replace("<ImageView\n",
  338. "<androidx.appcompat.widget.AppCompatImageView\n")
  339. return text
  340. def replace_xml_textview(text):
  341. text = text.replace("com.xmcy.hykb.app.view.KBTextView", "com.xmcy.hykb.view.KipoTextView")
  342. text = text.replace("KBTextView", "KipoTextView")
  343. return text
  344. def replace_system_bar(text):
  345. text = text.replace("getColorResId(R.color.white)", "getColorResId(R.color.bg_white)")
  346. text = text.replace("getColorResId(R.color.color_cccfd1d0)", "getColorResId(R.color.black_h5_80)")
  347. text = text.replace("getColorResId(R.color.whitesmoke)", "getColorResId(R.color.bg_deep)")
  348. text = text.replace("SystemBarHelper.setStatusBarMode(this, true)",
  349. "SystemBarHelper.setStatusBarMode(this, getResources().getBoolean(R.bool.status_bar_dark_font))")
  350. text = text.replace("SystemBarHelper.tintStatusBar(this, getColorResId(R.color.bg_light))",
  351. "SystemBarHelper.tintStatusBar(this, getColorResId(R.color.bg_deep))")
  352. return text
  353. def replace_back_icon(text):
  354. text = text.replace("gamedetail_icon_nav_come_back3", "bar_back")
  355. text = text.replace("icon_back_black", "bar_back")
  356. text = text.replace("nav_come_back", "bar_back")
  357. return text
  358. def replace_arrow_icon(text):
  359. text = text.replace("accredit_icon_check", "set_sign_tick")
  360. text = text.replace("gamedetails_icon_into", "set_icon_arrow")
  361. text = text.replace("home_icon_arrow_gray2", "set_icon_arrow")
  362. text = text.replace("cloudgame_icon_arrow_big", "set_icon_arrow")
  363. text = text.replace("android:drawableRight=\"@drawable/icon_more\"",
  364. "app:drawableEndCompat=\"@drawable/set_icon_arrow\"")
  365. text = text.replace("android:src=\"@drawable/icon_more\"",
  366. "android:src=\"@drawable/set_icon_arrow\"")
  367. return text
  368. def replace_background(text):
  369. text = text.replace("android:background=\"@android:color/white\"", "android:background=\"@color/bg_white\"")
  370. text = text.replace("android:background=\"@color/white\"", "android:background=\"@color/bg_white\"")
  371. text = text.replace("android:background=\"@color/whitesmoke\"", "android:background=\"@color/bg_deep\"")
  372. text = text.replace("app:bl_solid_color=\"@color/white\"", "app:bl_solid_color=\"@color/bg_white\"")
  373. text = text.replace("app:bl_solid_color=\"@android:color/white\"", "app:bl_solid_color=\"@color/bg_white\"")
  374. text = text.replace("app:bl_solid_color=\"#ffffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
  375. text = text.replace("app:bl_solid_color=\"#ffffff\"", "app:bl_solid_color=\"@color/bg_white\"")
  376. text = text.replace("app:bl_solid_color=\"#FFFFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
  377. text = text.replace("app:bl_solid_color=\"#FFFFFF\"", "app:bl_solid_color=\"@color/bg_white\"")
  378. text = text.replace("android:drawable=\"@color/white\"", "android:drawable=\"@color/bg_white\"")
  379. text = text.replace("android:drawable=\"@android:color/white\"", "android:drawable=\"@color/bg_white\"")
  380. text = text.replace("@drawable/bg_default_navigate_click", "?actionBarItemBackground")
  381. return text