mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-05 18:25:23 +08:00
Modify add warn dialog when notify icon compat mode is enable in MainActivity
This commit is contained in:
@@ -204,8 +204,20 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
}
|
}
|
||||||
binding.colorIconCompatSwitch.setOnCheckedChangeListener { btn, b ->
|
binding.colorIconCompatSwitch.setOnCheckedChangeListener { btn, b ->
|
||||||
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
||||||
modulePrefs.put(DataConst.ENABLE_COLOR_ICON_COMPAT, b)
|
/** 保存当前配置并生效 */
|
||||||
SystemUITool.refreshSystemUI(context = this)
|
fun saveConfigs() {
|
||||||
|
modulePrefs.put(DataConst.ENABLE_COLOR_ICON_COMPAT, b)
|
||||||
|
SystemUITool.refreshSystemUI(context = this)
|
||||||
|
}
|
||||||
|
if (b) showDialog {
|
||||||
|
title = "启用兼容模式"
|
||||||
|
msg = "启用兼容模式可修复部分系统版本可能出现无法判定通知图标反色的问题," +
|
||||||
|
"但是这也可能会导致新的问题,一般情况下不建议开启,确定要继续吗?\n\n" +
|
||||||
|
"如果系统界面刷新后通知图标颜色发生错误,请尝试重启一次系统界面。"
|
||||||
|
confirmButton { saveConfigs() }
|
||||||
|
cancelButton { btn.isChecked = false }
|
||||||
|
noCancelable()
|
||||||
|
} else saveConfigs()
|
||||||
}
|
}
|
||||||
binding.notifyIconFixSwitch.setOnCheckedChangeListener { btn, b ->
|
binding.notifyIconFixSwitch.setOnCheckedChangeListener { btn, b ->
|
||||||
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
||||||
|
Reference in New Issue
Block a user