mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
显示 WIFI 角标 (#166)
This commit is contained in:
@@ -319,6 +319,10 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.show_wifi_standard),
|
||||
SwitchV("show_wifi_standard")
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.custom_mobile_type_text
|
||||
|
||||
@@ -43,6 +43,7 @@ object SystemUI: AppRegister() {
|
||||
CustomMobileTypeText, //自定义移动类型文本
|
||||
CanNotificationSlide, //允许下滑通知打开小窗
|
||||
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
|
||||
ShowWifiStandard, // 显示 WIFI 角标
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
|
||||
|
||||
object ShowWifiStandard : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||
name == "initViewState" && parameterCount == 1
|
||||
}.hookBefore {
|
||||
hasEnable("show_wifi_standard") {
|
||||
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
|
||||
name == "copyTo" && parameterCount == 1
|
||||
}.hookBefore {
|
||||
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
|
||||
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||
name == "updateState" && parameterCount == 1
|
||||
}.hookBefore {
|
||||
hasEnable("show_wifi_standard") {
|
||||
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState") {
|
||||
name == "copyTo" && parameterCount == 1
|
||||
}.hookBefore {
|
||||
val wifiStandard = it.thisObject.getObjectAs<Int>("wifiStandard")
|
||||
it.thisObject.putObject("showWifiStandard", wifiStandard != 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,7 @@
|
||||
<string name="left">Left</string>
|
||||
<string name="right">Right</string>
|
||||
<string name="big_mobile_type_icon">Big Mobile Type Icon</string>
|
||||
<string name="show_wifi_standard">Show Wifi Standard</string>
|
||||
<string name="can_notification_slide">Make most notifications can be slide to small window</string>
|
||||
<string name="battery_percentage_font_size">Battery percentage font size</string>
|
||||
<string name="zero_do_no_change">0: do not change</string>
|
||||
|
||||
Reference in New Issue
Block a user