Modify add warn dialog when notify icon compat mode is enable in MainActivity

This commit is contained in:
2023-01-28 01:15:54 +08:00
parent ec3f07791b
commit 210c6898ab

View File

@@ -204,8 +204,20 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
binding.colorIconCompatSwitch.setOnCheckedChangeListener { btn, b ->
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 ->
if (btn.isPressed.not()) return@setOnCheckedChangeListener