mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
新增隐藏电量百分号
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 30
|
minSdk = 30
|
||||||
targetSdk = 32
|
targetSdk = 32
|
||||||
versionCode = 15
|
versionCode = 16
|
||||||
versionName = "1.1.4"
|
versionName = "1.1.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
SwitchV("status_bar_network_speed_refresh_speed")
|
SwitchV("status_bar_network_speed_refresh_speed")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
add(
|
||||||
|
TextWithSwitchV(
|
||||||
|
TextV(resId = R.string.hide_battery_percentage_icon),
|
||||||
|
SwitchV("hide_battery_percentage_icon")
|
||||||
|
)
|
||||||
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.hide_status_bar_network_speed_second),
|
TextV(resId = R.string.hide_status_bar_network_speed_second),
|
||||||
|
|||||||
@@ -557,6 +557,35 @@ class SystemUI : IXposedHookLoadPackage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//隐藏电量百分号
|
||||||
|
try {
|
||||||
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
|
"com.android.systemui.statusbar.views.MiuiBatteryMeterView",
|
||||||
|
lpparam.classLoader
|
||||||
|
)
|
||||||
|
XposedHelpers.findAndHookMethod(
|
||||||
|
classIfExists,
|
||||||
|
"updateResources",
|
||||||
|
object : XC_MethodHook() {
|
||||||
|
override fun afterHookedMethod(param: MethodHookParam) {
|
||||||
|
if (prefs.hasFileChanged()) {
|
||||||
|
prefs.reload()
|
||||||
|
}
|
||||||
|
if (prefs.getBoolean("hide_battery_percentage_icon", false)) {
|
||||||
|
val mBatteryPercentMarkView = XposedHelpers.getObjectField(
|
||||||
|
param.thisObject,
|
||||||
|
"mBatteryPercentMarkView"
|
||||||
|
) as TextView
|
||||||
|
mBatteryPercentMarkView.textSize = 0F
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (e: Exception) {
|
||||||
|
XposedBridge.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,5 +55,6 @@
|
|||||||
<string name="unlock_unlimited_cropping">解锁无限裁切图片/截图</string>
|
<string name="unlock_unlimited_cropping">解锁无限裁切图片/截图</string>
|
||||||
<string name="hide_slave_wifi_icon">隐藏 辅助WIFI 图标</string>
|
<string name="hide_slave_wifi_icon">隐藏 辅助WIFI 图标</string>
|
||||||
<string name="HideLauncherIcon">隐藏桌面图标</string>
|
<string name="HideLauncherIcon">隐藏桌面图标</string>
|
||||||
|
<string name="hide_battery_percentage_icon">隐藏电量(%)</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user