代码拉取完成,页面将自动刷新
同步操作将从 自然萌/android_packages_apps_Settings 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/python
import os
# assume everything needs alpha suffixes
for root, dirs, files in os.walk('.'):
if "res/drawable-" not in root: continue
for before in files:
if "_alpha.png" in before: continue
if not before.startswith("ic_settings_"): continue
after = before.replace(".png", "_alpha.png")
os.rename(os.path.join(root, before), os.path.join(root, after))
# build xml redirection
for root, dirs, files in os.walk('.'):
if "res/drawable-" not in root: continue
for src in files:
if not src.endswith(".png"): continue
src = src[0:-4]
src_clause = '\n android:src="@drawable/%s"' % (src)
alpha = src.endswith("_alpha")
if alpha:
src = src[0:-6]
alpha_clause = '\n android:tint="?android:attr/colorAccent"'
else:
alpha_clause = ''
am = src.endswith("_am")
if am:
src = src[0:-3]
am_clause = '\n android:autoMirrored="true"'
else:
am_clause = ''
with open("res/drawable/%s.xml" % (src), 'w') as xml:
xml.write("""<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"%s%s%s />
""" % (src_clause, alpha_clause, am_clause))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。