Merge code

This commit is contained in:
2022-03-29 21:45:19 +08:00
parent 66f309dc91
commit 230b3b4e38

View File

@@ -607,8 +607,11 @@ class SystemUIHooker : YukiBaseHooker() {
} }
afterHook { afterHook {
if (firstArgs != null) instance<ImageView>().also { if (firstArgs != null) instance<ImageView>().also {
/** 注册壁纸颜色监听 */
registerWallpaperColorChanged(it) registerWallpaperColorChanged(it)
/** 注册广播 */
registerReceiver(it.context) registerReceiver(it.context)
/** 缓存实例 */
statusBarIconViews.add(it) statusBarIconViews.add(it)
} }
} }
@@ -691,11 +694,16 @@ class SystemUIHooker : YukiBaseHooker() {
param(ContextClass, IntentClass) param(ContextClass, IntentClass)
} }
afterHook { afterHook {
if (isEnableHookColorNotifyIcon() && prefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO)) firstArgs<Context>()?.also {
IconAdaptationTool.prepareAutoUpdateIconRule( /** 注册广播 */
context = firstArgs()!!, registerReceiver(it)
timeSet = prefs.get(DataConst.NOTIFY_ICON_FIX_AUTO_TIME) /** 注册定时监听 */
) if (isEnableHookColorNotifyIcon() && prefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO))
IconAdaptationTool.prepareAutoUpdateIconRule(
context = it,
timeSet = prefs.get(DataConst.NOTIFY_ICON_FIX_AUTO_TIME)
)
}
} }
} }
} }