From f2bccafd926a48026e8f0ba5927c43917161d426 Mon Sep 17 00:00:00 2001 From: Fankesyooni Date: Mon, 7 Feb 2022 00:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fankes/miui/notify/ui/MainActivity.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/fankes/miui/notify/ui/MainActivity.kt b/app/src/main/java/com/fankes/miui/notify/ui/MainActivity.kt index 7684a9e..862d447 100644 --- a/app/src/main/java/com/fankes/miui/notify/ui/MainActivity.kt +++ b/app/src/main/java/com/fankes/miui/notify/ui/MainActivity.kt @@ -99,15 +99,6 @@ class MainActivity : BaseActivity() { noCancelable() } } - /** MIUI 12 的版本特殊 - 所以给出提示 */ - if (miuiVersion == "12" && isMiuiNotifyStyle) - showDialog { - title = "经典通知栏样式已启用" - msg = "在 MIUI 12 中启用了经典通知栏样式后状态栏图标将不再做原生处理,模块停止工作," + - "这取决于系统设置,你应当在 设置>通知管理>通知显示设置 中将样式设置为“原生样式”。" - confirmButton(text = "我知道了") - noCancelable() - } /** 初始化 View */ val moduleEnableSwitch = findViewById(R.id.module_enable_switch) val moduleEnableLogSwitch = findViewById(R.id.module_enable_log_switch) @@ -193,6 +184,19 @@ class MainActivity : BaseActivity() { } } + override fun onResume() { + super.onResume() + /** MIUI 12 的版本特殊 - 所以给出提示 */ + if (isHooked() && miuiVersion == "12" && isMiuiNotifyStyle) + showDialog { + title = "经典通知栏样式已启用" + msg = "在 MIUI 12 中启用了经典通知栏样式后状态栏图标将不再做原生处理,模块停止工作," + + "这取决于系统设置,你应当在 设置>通知管理>通知显示设置 中将样式设置为“原生样式”。" + confirmButton(text = "我知道了") + noCancelable() + } + } + /** * 判断模块是否激活 * @return [Boolean] 激活状态