Skip to content

Commit

Permalink
隐藏锁屏界面的勿扰模式通知
Browse files Browse the repository at this point in the history
  • Loading branch information
hosizoraru committed Jun 20, 2023
1 parent 55f23cf commit 2a94999
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package star.sky.voyager.activity.pages.sub

import android.view.View
import cn.fkj233.ui.activity.MIUIActivity
import cn.fkj233.ui.activity.MIUIActivity.Companion.safeSP
import cn.fkj233.ui.activity.annotation.BMPage
import cn.fkj233.ui.activity.data.BasePage
import cn.fkj233.ui.activity.view.SeekBarWithTextV
Expand Down Expand Up @@ -50,6 +50,10 @@ class LockScreenPage : BasePage() {
tipsId = R.string.only_official_default_themes_are_supported
), SwitchV("remove_lock_screen_camera")
)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.lock_screen_zen_mode),
SwitchV("lock_screen_zen_mode")
)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.enable_wave_charge_animation),
SwitchV("enable_wave_charge_animation")
Expand All @@ -61,7 +65,7 @@ class LockScreenPage : BasePage() {
), SwitchV("lock_screen_charging_current")
)
val chargingInfo = GetDataBinding({
MIUIActivity.safeSP.getBoolean(
safeSP.getBoolean(
"lockscreen_charging_info",
false
)
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/kotlin/star/sky/voyager/hook/apps/SystemUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import star.sky.voyager.hook.hooks.systemui.LockScreenClockDisplaySeconds
import star.sky.voyager.hook.hooks.systemui.LockScreenCurrent
import star.sky.voyager.hook.hooks.systemui.LockScreenDoubleTapToSleep
import star.sky.voyager.hook.hooks.systemui.LockScreenFont
import star.sky.voyager.hook.hooks.systemui.LockScreenZenMode
import star.sky.voyager.hook.hooks.systemui.LockscreenChargingInfo
import star.sky.voyager.hook.hooks.systemui.MaximumNumberOfNotificationIcons
import star.sky.voyager.hook.hooks.systemui.MonetTheme
Expand Down Expand Up @@ -83,6 +84,7 @@ object SystemUI : AppRegister() {
WaveCharge, // 启用Alpha充电动画
LockScreenCurrent, // 充电时显示当前电流
LockScreenDoubleTapToSleep, // 锁屏-双击锁定屏幕
LockScreenZenMode, // 隐藏锁屏界面的勿扰模式通知
NoPasswordHook, // 开机免输密码
OldQSCustom, // 自定义行列数
// 状态栏网络速度 Start
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package star.sky.voyager.hook.hooks.systemui

import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import star.sky.voyager.utils.init.HookRegister
import star.sky.voyager.utils.key.hasEnable

object LockScreenZenMode : HookRegister() {
override fun init() = hasEnable("lock_screen_zen_mode") {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController").methodFinder()
.filterByName("shouldBeVisible")
.first().createHook {
returnConstant(false)
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@
<string name="blur_lock_screen_button">ボタンをぼかす</string>
<string name="remove_the_left_side_of_the_lock_screen">ロックスクリーンから -1 画面の機能を削除</string>
<string name="remove_lock_screen_camera">ロックスクリーンのカメラ機能を削除</string>
<string name="lock_screen_zen_mode">ロック画面での勿扰モード通知の非表示</string>
<string name="enable_wave_charge_animation">Alpha 充電アニメーションを有効にする</string>
<string name="lock_screen_charging_current">充電時に現在の電流を表示</string>
<string name="current_mA">電流単位は mA を使用</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@
<string name="blur_lock_screen_button">模糊按钮</string>
<string name="remove_the_left_side_of_the_lock_screen">移除锁屏负一屏功能</string>
<string name="remove_lock_screen_camera">移除锁屏相机功能</string>
<string name="lock_screen_zen_mode">隐藏锁屏界面的勿扰模式通知</string>
<string name="enable_wave_charge_animation">启用 Alpha 充电动画</string>
<string name="lock_screen_charging_current">充电时显示当前电流</string>
<string name="current_mA">电流单位使用 mA</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@
<string name="blur_lock_screen_button">Blur button</string>
<string name="remove_the_left_side_of_the_lock_screen">Remove the lock screen side panel</string>
<string name="remove_lock_screen_camera">Remove the lock screen camera feature</string>
<string name="lock_screen_zen_mode">Hide Zen Mode notification on lock screen</string>
<string name="enable_wave_charge_animation">Enable wave charge animation</string>
<string name="lock_screen_charging_current">Display current information during charging</string>
<string name="current_mA">The current unit uses mA</string>
Expand Down

0 comments on commit 2a94999

Please sign in to comment.