新增允许下滑所有通知变成小窗 (#104)

This commit is contained in:
YifePlayte
2022-03-23 14:10:02 +08:00
committed by GitHub
parent 509fef5e06
commit bfff5cc446
4 changed files with 32 additions and 0 deletions

View File

@@ -903,6 +903,14 @@ class SettingsActivity : MIUIActivity() {
dataBindingRecv = show_weather_main_switch_binding.binding.getRecv(2)
)
)
add(
TextSummaryWithSwitchV(
TextSummaryV(
textId = R.string.can_notification_slide,
),
SwitchV("can_notification_slide")
)
)
add(LineV())
add(TitleTextV(resId = R.string.control_center))

View File

@@ -60,6 +60,8 @@ class SystemUI : IXposedHookLoadPackage {
DoubleLineNetworkSpeed().handleLoadPackage(lpparam)
StatusBarBigMobileTypeIcon().handleLoadPackage(lpparam)
//允许下滑通知打开小窗
CanNotificationSlide().handleLoadPackage(lpparam)
}
}

View File

@@ -0,0 +1,21 @@
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 de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
class CanNotificationSlide : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
findMethod("com.android.systemui.statusbar.notification.policy.AppMiniWindowManager") {
name == "canNotificationSlide"
}.hookMethod {
after { param ->
hasEnable("can_notification_slide") {
param.result = true
}
}
}
}
}

View File

@@ -181,4 +181,5 @@
<string name="left">Left</string>
<string name="right">Right</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>
</resources>