mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-08 03:24:11 +08:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
117b37b5cf
|
|||
967186bd00
|
|||
eea7b6d897
|
|||
dd75a13970
|
|||
66ed43f5ad
|
|||
399cfafd29 | |||
6ae1d3e726 | |||
384e6b657e | |||
08b7feeede | |||
e7fc0bbcd0 | |||
1f8022fd7c | |||
|
b404543f47 | ||
|
ad195d93ea | ||
15e7490808 | |||
7c906cd2a0 | |||
0da5875d64 |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -11,7 +11,7 @@
|
||||
<entry key="app/src/main/res/drawable/ic_notify_icon.xml" value="0.232" />
|
||||
<entry key="app/src/main/res/drawable/ic_system_clock.xml" value="0.232" />
|
||||
<entry key="app/src/main/res/layout/activity_config.xml" value="0.4375" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.31423220973782773" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.31170825335892516" />
|
||||
<entry key="app/src/main/res/layout/adapter_config.xml" value="0.4375" />
|
||||
<entry key="app/src/main/res/layout/dia_icon_filter.xml" value="0.4375" />
|
||||
<entry key="app/src/main/res/layout/dia_source_from.xml" value="0.4375" />
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://github.com/fankes/ColorOSNotifyIcon)
|
||||
[](https://github.com/fankes/ColorOSNotifyIcon/blob/master/LICENSE)
|
||||
[](https://github.com/fankes/ColorOSNotifyIcon/releases)
|
||||
[](https://github.com/fankes/ColorOSNotifyIcon/releases)
|
||||
[](https://github.com/fankes/ColorOSNotifyIcon/releases)
|
||||
[](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
|
||||
[](https://t.me/XiaofangInternet)
|
||||
|
@@ -69,8 +69,8 @@ tasks.whenTaskAdded {
|
||||
|
||||
dependencies {
|
||||
compileOnly 'de.robv.android.xposed:api:82'
|
||||
implementation 'com.highcapable.yukihookapi:api:1.0.81'
|
||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.81'
|
||||
implementation 'com.highcapable.yukihookapi:api:1.0.86'
|
||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.86'
|
||||
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
||||
implementation 'androidx.annotation:annotation:1.3.0'
|
||||
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.0'
|
||||
@@ -78,7 +78,7 @@ dependencies {
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'com.google.android.material:material:1.6.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
|
@@ -41,7 +41,7 @@ object Const {
|
||||
const val MODULE_VERSION_CODE = BuildConfig.VERSION_CODE
|
||||
|
||||
/** 当前模块的版本校验 */
|
||||
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_202205040646"
|
||||
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_202205090117"
|
||||
|
||||
/** 当前模块的版本校验标签 */
|
||||
const val MODULE_VERSION_VERIFY_TAG = "module_version_verify"
|
||||
|
@@ -38,7 +38,7 @@ object DataConst {
|
||||
val REMOVE_CHANGECP_NOTIFY = PrefsData("_remove_charge_complete_notify", false)
|
||||
val REMOVE_DNDALERT_NOTIFY = PrefsData("_remove_dndalert_notify", false)
|
||||
val ENABLE_NOTIFY_ICON_FIX_AUTO = PrefsData("_enable_notify_icon_fix_auto", true)
|
||||
val ENABLE_NOTIFY_PANEL_ALPHA = PrefsData("_enable_notify_panel_alpha", true)
|
||||
val ENABLE_NOTIFY_PANEL_ALPHA = PrefsData("_enable_notify_panel_alpha", false)
|
||||
val NOTIFY_PANEL_ALPHA = PrefsData("_notify_panel_alpha", 185)
|
||||
val NOTIFY_ICON_DATAS = PrefsData("_notify_icon_datas", "")
|
||||
val NOTIFY_ICON_FIX_AUTO_TIME = PrefsData("_notify_icon_fix_auto_time", "07:00")
|
||||
|
@@ -47,7 +47,7 @@ class HookEntry : IYukiHookXposedInit {
|
||||
/** Hook 被手动关闭停止 Hook */
|
||||
prefs.get(DataConst.ENABLE_MODULE).not() -> loggerW(msg = "Aborted Hook -> Hook Closed")
|
||||
/** 开始 Hook */
|
||||
else -> loadApp(SYSTEMUI_PACKAGE_NAME, SystemUIHooker())
|
||||
else -> loadApp(SYSTEMUI_PACKAGE_NAME, SystemUIHooker)
|
||||
}
|
||||
}
|
||||
}
|
@@ -20,6 +20,8 @@
|
||||
*
|
||||
* This file is Created by fankes on 2022/3/25.
|
||||
*/
|
||||
@file:Suppress("StaticFieldLeak")
|
||||
|
||||
package com.fankes.coloros.notify.hook.entity
|
||||
|
||||
import android.app.WallpaperManager
|
||||
@@ -71,111 +73,108 @@ import com.highcapable.yukihookapi.hook.type.java.LongType
|
||||
/**
|
||||
* 系统界面核心 Hook 类
|
||||
*/
|
||||
class SystemUIHooker : YukiBaseHooker() {
|
||||
object SystemUIHooker : YukiBaseHooker() {
|
||||
|
||||
companion object {
|
||||
/** 原生存在的类 */
|
||||
private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil"
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationUtilsClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationUtils"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationUtilsClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationUtils"
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationEntryClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.collection.NotificationEntry"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationEntryClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.collection.NotificationEntry"
|
||||
/** 原生存在的类 */
|
||||
private const val StatusBarIconClass = "com.android.internal.statusbar.StatusBarIcon"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val StatusBarIconClass = "com.android.internal.statusbar.StatusBarIcon"
|
||||
/** 原生存在的类 */
|
||||
private const val StatusBarIconViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.StatusBarIconView"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val StatusBarIconViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.StatusBarIconView"
|
||||
/** 原生存在的类 */
|
||||
private const val IconBuilderClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconBuilder"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val IconBuilderClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconBuilder"
|
||||
/** 原生存在的类 */
|
||||
private const val IconManagerClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconManager"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val IconManagerClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.icon.IconManager"
|
||||
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||
private const val OplusContrastColorUtilClass = "com.oplusos.util.OplusContrastColorUtil"
|
||||
|
||||
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||
private const val OplusContrastColorUtilClass = "com.oplusos.util.OplusContrastColorUtil"
|
||||
/** 原生存在的类 */
|
||||
private const val PluginManagerImplClass = "$SYSTEMUI_PACKAGE_NAME.shared.plugins.PluginManagerImpl"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val PluginManagerImplClass = "$SYSTEMUI_PACKAGE_NAME.shared.plugins.PluginManagerImpl"
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationBackgroundViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.NotificationBackgroundView"
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val NotificationBackgroundViewClass = "$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.NotificationBackgroundView"
|
||||
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||
private const val OplusNotificationBackgroundViewClass =
|
||||
"com.oplusos.systemui.statusbar.notification.row.OplusNotificationBackgroundView"
|
||||
|
||||
/** ColorOS 存在的类 - 旧版本不存在 */
|
||||
private const val OplusNotificationBackgroundViewClass =
|
||||
"com.oplusos.systemui.statusbar.notification.row.OplusNotificationBackgroundView"
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val OplusNotificationIconAreaControllerClass = VariousClass(
|
||||
"com.oplusos.systemui.statusbar.phone.OplusNotificationIconAreaController",
|
||||
"com.oplusos.systemui.statusbar.policy.OplusNotificationIconAreaController",
|
||||
"com.coloros.systemui.statusbar.policy.ColorNotificationIconAreaController"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val OplusNotificationIconAreaControllerClass = VariousClass(
|
||||
"com.oplusos.systemui.statusbar.phone.OplusNotificationIconAreaController",
|
||||
"com.oplusos.systemui.statusbar.policy.OplusNotificationIconAreaController",
|
||||
"com.coloros.systemui.statusbar.policy.ColorNotificationIconAreaController"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val SystemPromptControllerClass = VariousClass(
|
||||
"com.oplusos.systemui.statusbar.policy.SystemPromptController",
|
||||
"com.coloros.systemui.statusbar.policy.ColorSystemPromptController"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val SystemPromptControllerClass = VariousClass(
|
||||
"com.oplusos.systemui.statusbar.policy.SystemPromptController",
|
||||
"com.coloros.systemui.statusbar.policy.ColorSystemPromptController"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val RoundRectDrawableUtilClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil",
|
||||
"com.coloros.systemui.notification.util.RoundRectDrawableUtil"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val RoundRectDrawableUtilClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil",
|
||||
"com.coloros.systemui.notification.util.RoundRectDrawableUtil"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val RoundRectDrawableUtil_CompanionClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion",
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val RoundRectDrawableUtil_CompanionClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion",
|
||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val DndAlertHelperClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.helper.DndAlertHelper",
|
||||
"com.coloros.systemui.notification.helper.DndAlertHelper"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val DndAlertHelperClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.helper.DndAlertHelper",
|
||||
"com.coloros.systemui.notification.helper.DndAlertHelper"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val OplusPowerNotificationWarningsClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.power.OplusPowerNotificationWarnings",
|
||||
"com.coloros.systemui.notification.power.ColorosPowerNotificationWarnings"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val OplusPowerNotificationWarningsClass = VariousClass(
|
||||
"com.oplusos.systemui.notification.power.OplusPowerNotificationWarnings",
|
||||
"com.coloros.systemui.notification.power.ColorosPowerNotificationWarnings"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val AbstractReceiverClass = VariousClass(
|
||||
"com.oplusos.systemui.common.receiver.AbstractReceiver",
|
||||
"com.coloros.systemui.common.receiver.AbstractReceiver"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val AbstractReceiverClass = VariousClass(
|
||||
"com.oplusos.systemui.common.receiver.AbstractReceiver",
|
||||
"com.coloros.systemui.common.receiver.AbstractReceiver"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val StatusBarNotificationPresenterClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.phone.StatusBarNotificationPresenter",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.phone.StatusBar"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val StatusBarNotificationPresenterClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.phone.StatusBarNotificationPresenter",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.phone.StatusBar"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val ExpandableNotificationRowClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.ExpandableNotificationRow",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.ExpandableNotificationRow"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val ExpandableNotificationRowClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.ExpandableNotificationRow",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.ExpandableNotificationRow"
|
||||
)
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val NotificationViewWrapperClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.wrapper.NotificationViewWrapper",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationViewWrapper"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val NotificationViewWrapperClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.wrapper.NotificationViewWrapper",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationViewWrapper"
|
||||
)
|
||||
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val NotificationHeaderViewWrapperClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationHeaderViewWrapper"
|
||||
)
|
||||
}
|
||||
/** 根据多个版本存在不同的包名相同的类 */
|
||||
private val NotificationHeaderViewWrapperClass = VariousClass(
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationHeaderViewWrapper"
|
||||
)
|
||||
|
||||
/** 缓存的彩色 APP 图标 */
|
||||
private var appIcons = ArrayMap<String, Drawable>()
|
||||
@@ -534,12 +533,20 @@ class SystemUIHooker : YukiBaseHooker() {
|
||||
|
||||
/**
|
||||
* 设置通知面板背景透明度
|
||||
* @param view 背景 View 实例
|
||||
* @param drawable 背景实例
|
||||
*/
|
||||
private fun modifyNotifyPanelAlpha(drawable: Drawable?) {
|
||||
if (prefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA))
|
||||
drawable?.alpha = prefs.get(DataConst.NOTIFY_PANEL_ALPHA)
|
||||
else drawable?.alpha = 255
|
||||
private fun modifyNotifyPanelAlpha(view: View?, drawable: Drawable?) {
|
||||
prefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA).also { isEnabled ->
|
||||
/** 设置通知面板背景透明度 */
|
||||
when {
|
||||
isEnabled.not() -> drawable?.alpha = 255
|
||||
view?.parent?.parent?.javaClass?.name?.contains(other = "ChildrenContainer") == true -> drawable?.alpha = 0
|
||||
else -> drawable?.alpha = prefs.get(DataConst.NOTIFY_PANEL_ALPHA)
|
||||
}
|
||||
/** 移除阴影效果 */
|
||||
if (isEnabled) view?.elevation = 0f
|
||||
}
|
||||
}
|
||||
|
||||
/** 缓存图标数据 */
|
||||
@@ -703,8 +710,13 @@ class SystemUIHooker : YukiBaseHooker() {
|
||||
method {
|
||||
name = "drawRegionBlur"
|
||||
paramCount = 2
|
||||
}.remedys {
|
||||
method {
|
||||
name = "draw"
|
||||
paramCount = 2
|
||||
}
|
||||
}
|
||||
beforeHook { modifyNotifyPanelAlpha(args().last().cast<Drawable>()) }
|
||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||
}
|
||||
injectMember {
|
||||
method {
|
||||
@@ -712,7 +724,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
||||
paramCount = 2
|
||||
superClass(isOnlySuperClass = true)
|
||||
}
|
||||
beforeHook { modifyNotifyPanelAlpha(args().last().cast<Drawable>()) }
|
||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||
}
|
||||
}.by { isOldNotificationBackground.not() }
|
||||
/** 替换通知面板背景 - 旧版本 */
|
||||
@@ -722,16 +734,29 @@ class SystemUIHooker : YukiBaseHooker() {
|
||||
name = "draw"
|
||||
paramCount = 2
|
||||
}
|
||||
beforeHook { modifyNotifyPanelAlpha(args().last().cast<Drawable>()) }
|
||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||
}
|
||||
injectMember {
|
||||
method {
|
||||
name = "drawCustom"
|
||||
paramCount = 2
|
||||
}
|
||||
beforeHook { modifyNotifyPanelAlpha(args().last().cast<Drawable>()) }
|
||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||
}
|
||||
}.by { isOldNotificationBackground }
|
||||
/** 替换通知面板背景 - 避免折叠展开通知二次修改通知面板背景 */
|
||||
ExpandableNotificationRowClass.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "updateBackgroundForGroupState"
|
||||
emptyParam()
|
||||
}
|
||||
beforeHook {
|
||||
if (prefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA))
|
||||
field { name = "mShowGroupBackgroundWhenExpanded" }.get(instance).setTrue()
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 替换通知图标和样式 */
|
||||
NotificationHeaderViewWrapperClass.hook {
|
||||
injectMember {
|
||||
|
@@ -126,7 +126,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
binding.notifyIconAutoSyncItem.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX)
|
||||
binding.notifyIconAutoSyncChildItem.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO)
|
||||
binding.notifyPanelConfigSeekbar.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
|
||||
binding.notifyPanelConfigText.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
|
||||
binding.notifyPanelConfigTextPanel.isVisible = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
|
||||
binding.devNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_DEV_NOTIFY)
|
||||
binding.crcpNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_CHANGECP_NOTIFY)
|
||||
binding.dndNotifyConfigSwitch.isChecked = modulePrefs.get(DataConst.REMOVE_DNDALERT_NOTIFY)
|
||||
@@ -139,7 +139,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
binding.notifyIconAutoSyncSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_NOTIFY_ICON_FIX_AUTO)
|
||||
binding.notifyPanelConfigSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_NOTIFY_PANEL_ALPHA)
|
||||
binding.notifyPanelConfigSeekbar.progress = modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA)
|
||||
binding.notifyPanelConfigText.text = "当前值 - ${modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA)}"
|
||||
binding.notifyPanelConfigText.text = modulePrefs.get(DataConst.NOTIFY_PANEL_ALPHA).toString()
|
||||
binding.notifyIconAutoSyncText.text = notifyIconAutoSyncTime
|
||||
binding.moduleEnableSwitch.setOnCheckedChangeListener { btn, b ->
|
||||
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
||||
@@ -200,7 +200,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
binding.notifyPanelConfigSwitch.setOnCheckedChangeListener { btn, b ->
|
||||
if (btn.isPressed.not()) return@setOnCheckedChangeListener
|
||||
modulePrefs.put(DataConst.ENABLE_NOTIFY_PANEL_ALPHA, b)
|
||||
binding.notifyPanelConfigText.isVisible = b
|
||||
binding.notifyPanelConfigTextPanel.isVisible = b
|
||||
binding.notifyPanelConfigSeekbar.isVisible = b
|
||||
SystemUITool.refreshSystemUI(context = this)
|
||||
}
|
||||
@@ -212,7 +212,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
}
|
||||
binding.notifyPanelConfigSeekbar.setOnSeekBarChangeListener(object : OnSeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||
binding.notifyPanelConfigText.text = "当前值 - $progress"
|
||||
binding.notifyPanelConfigText.text = progress.toString()
|
||||
}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||
|
@@ -43,13 +43,13 @@ class NotifyIconRuleUpdateActivity : Activity() {
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
window?.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
|
||||
window?.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
|
||||
/** 注册 */
|
||||
SystemUITool.register(context = this)
|
||||
/** 检测运行状态 */
|
||||
if (BaseActivity.isMainThreadRunning) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
/** 注册 */
|
||||
SystemUITool.register(context = this)
|
||||
/** 拉取云端数据 */
|
||||
IconRuleManagerTool.sync(appContext) {
|
||||
/** 刷新系统界面 */
|
||||
|
@@ -47,7 +47,7 @@ object SystemUITool {
|
||||
* 注册广播
|
||||
* @param context 实例
|
||||
*/
|
||||
fun register(context: Context) {
|
||||
fun register(context: Context) = runInSafe {
|
||||
/** 注册广播检查模块激活状态 */
|
||||
context.registerReceiver(moduleHandlerReceiver, IntentFilter().apply { addAction(Const.ACTION_MODULE_HANDLER_RECEIVER) })
|
||||
/** 注册广播通知系统界面改变 */
|
||||
@@ -58,7 +58,7 @@ object SystemUITool {
|
||||
* 取消注册广播
|
||||
* @param context 实例
|
||||
*/
|
||||
fun unregister(context: Context) {
|
||||
fun unregister(context: Context) = runInSafe {
|
||||
context.unregisterReceiver(moduleHandlerReceiver)
|
||||
context.unregisterReceiver(remindHandlerReceiver)
|
||||
}
|
||||
|
@@ -443,19 +443,41 @@
|
||||
android:max="255"
|
||||
android:min="0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notify_panel_config_text"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/notify_panel_config_text_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxWidth="100dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:singleLine="true"
|
||||
android:text="当前值 - %1"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="14sp" />
|
||||
android:paddingBottom="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:alpha="0.75"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxWidth="100dp"
|
||||
android:singleLine="true"
|
||||
android:text="当前值"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="13.5sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/notify_panel_config_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxWidth="100dp"
|
||||
android:singleLine="true"
|
||||
android:text="%1"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@@ -468,6 +490,18 @@
|
||||
android:text="开启自定义功能后,你可以拖拽滑动条来调整通知面板的透明度,0 为全透明,255 为不透明。"
|
||||
android:textColor="@color/colorTextDark"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:alpha="0.6"
|
||||
android:lineSpacingExtra="6dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:text="此功能为实验性功能,后期不一定继续维护,且仅在 ColorOS 12.1 测试通过,不能保证可以在任何系统版本中生效,以及和各种通知栏主题模块配合使用,如有冲突请关闭此功能或禁用相关重复功能的主题模块。\n已知问题:悬浮通知也会被透明,在透明度较低的时候下拉会有阴影光晕,后期看需求再解决。"
|
||||
android:textColor="@color/colorTextDark"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@@ -5,8 +5,8 @@ plugins {
|
||||
}
|
||||
|
||||
ext {
|
||||
appVersionName = "1.7"
|
||||
appVersionCode = 12
|
||||
appVersionName = "1.76"
|
||||
appVersionCode = 14
|
||||
enableR8 = true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user