允许下滑大多数通知变成小窗 (#145)

* 允许下滑大多数通知变成小窗

* typo

* Update strings.xml
This commit is contained in:
YifePlayte
2022-04-17 03:01:20 +08:00
committed by GitHub
parent 1af01b391b
commit 57895c7f2c
4 changed files with 32 additions and 1 deletions

View File

@@ -745,6 +745,13 @@ class SettingsActivity : MIUIActivity() {
SwitchV("notification_weather_city"), SwitchV("notification_weather_city"),
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2) dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
) )
TextSummaryWithSwitch(
TextSummaryV(
textId = R.string.can_notification_slide,
tipsId = R.string.can_notification_slide_summary,
),
SwitchV("can_notification_slide"),
)
Line() Line()
TitleText(resId = R.string.control_center) TitleText(resId = R.string.control_center)
val controlCenterWeatherBinding = GetDataBinding(object : DefValue { val controlCenterWeatherBinding = GetDataBinding(object : DefValue {

View File

@@ -41,6 +41,7 @@ object SystemUI: AppRegister() {
StatusBarBigMobileTypeIcon, //大移动类型 StatusBarBigMobileTypeIcon, //大移动类型
BatteryPercentage, //电量百分比 BatteryPercentage, //电量百分比
CustomMobileTypeText, //自定义移动类型文本 CustomMobileTypeText, //自定义移动类型文本
CanNotificationSlide, //允许下滑通知打开小窗
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒 LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
) )
} }

View File

@@ -0,0 +1,22 @@
package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookMethod
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object CanNotificationSlide: HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") {
name == "canSlide"
}.hookMethod {
after { param ->
hasEnable("can_notification_slide") {
param.result = true
}
}
}
}
}

View File

@@ -181,7 +181,7 @@
<string name="left">Left</string> <string name="left">Left</string>
<string name="right">Right</string> <string name="right">Right</string>
<string name="big_mobile_type_icon">Big Mobile Type Icon</string> <string name="big_mobile_type_icon">Big Mobile Type Icon</string>
<string name="can_notification_slide">Make all notification can be slide to small window</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="battery_percentage_font_size">Battery percentage font size</string>
<string name="zero_do_no_change">0: do not change</string> <string name="zero_do_no_change">0: do not change</string>
<string name="big_mobile_type_icon_size">Big mobile type icon size</string> <string name="big_mobile_type_icon_size">Big mobile type icon size</string>
@@ -219,4 +219,5 @@
<string name="allow_untrusted_touches">Allow untrusted touches</string> <string name="allow_untrusted_touches">Allow untrusted touches</string>
<string name="take_effect_after_reboot">Take effect after reboot</string> <string name="take_effect_after_reboot">Take effect after reboot</string>
<string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string> <string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string>
<string name="can_notification_slide_summary">Some notifications through Mi Push may not be supported.</string>
</resources> </resources>