mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
新增允许下滑所有通知变成小窗 (#104)
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -60,6 +60,8 @@ class SystemUI : IXposedHookLoadPackage {
|
||||
DoubleLineNetworkSpeed().handleLoadPackage(lpparam)
|
||||
|
||||
StatusBarBigMobileTypeIcon().handleLoadPackage(lpparam)
|
||||
//允许下滑通知打开小窗
|
||||
CanNotificationSlide().handleLoadPackage(lpparam)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user