Merge code

This commit is contained in:
2022-03-24 15:09:02 +08:00
parent a174aa3928
commit e962ac2ecf

View File

@@ -364,24 +364,27 @@ object IconRuleManagerTool {
*/ */
fun refreshSystemUI(context: Context) { fun refreshSystemUI(context: Context) {
if (context !is AppCompatActivity) return if (context !is AppCompatActivity) return
if (isNotNoificationEnabled) context.showDialog { if (isNotNoificationEnabled)
title = "模块的通知权限已关闭" context.showDialog {
msg = "请开启通知权限然后重启系统界面,否则无法动态刷新系统界面使更改生效。" title = "模块的通知权限已关闭"
confirmButton { context.openNotifySetting() } msg = "请开启通知权限然后重启系统界面,否则无法动态刷新系统界面使更改生效。"
cancelButton() confirmButton { context.openNotifySetting() }
noCancelable() cancelButton()
} else context.showDialog { noCancelable()
title = "请稍后" }
progressContent = "正在刷新系统界面改变" else
/** 发送通知提醒宿主更新图标缓存 */ context.showDialog {
pushNotify(appContext, title = "请稍后", msg = "正在等待系统界面响应", isAction = false) title = "请稍后"
/** 刷新成功后取消通知 */ progressContent = "正在刷新系统界面改变"
Handler().postDelayed({ /** 发送通知提醒宿主更新图标缓存 */
context.getSystemService<NotificationManager>()?.cancel(1) pushNotify(appContext, title = "请稍后", msg = "正在等待系统界面响应", isAction = false)
cancel() /** 刷新成功后取消通知 */
}, 1000) Handler().postDelayed({
noCancelable() context.getSystemService<NotificationManager>()?.cancel(1)
} cancel()
}, 1000)
noCancelable()
}
} }
/** /**