mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-08 03:24:11 +08:00
Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
0d564258c9
|
|||
f172b6b1b9
|
|||
ecf7ed8653
|
|||
1efb18f4e1
|
|||
fa99a57027
|
|||
4d3106f5bc
|
|||
8f735ab23d
|
|||
3503cf35b1
|
|||
1d5759313b
|
|||
7dcd6de33e
|
|||
ff941171f9
|
|||
eeb7966448
|
|||
a1214f0f38
|
|||
855f88127d
|
|||
d589ef2cd0
|
|||
c95c36c76a
|
|||
2eec2022d1
|
|||
4b00d84d8b
|
|||
89767143bd
|
|||
e119fd0bf7
|
|||
bd08b2ce1d
|
|||
a334bf9a8c
|
|||
bad773cc2c
|
6
.secret/key_store_secret.json
Normal file
6
.secret/key_store_secret.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"keyAlias": "public",
|
||||||
|
"keyPassword": "123456",
|
||||||
|
"storeFileName": "universal.p12",
|
||||||
|
"storePassword": "123456"
|
||||||
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[](https://github.com/fankes/ColorOSNotifyIcon)
|
[](https://github.com/fankes/ColorOSNotifyIcon)
|
||||||
[](https://github.com/fankes/ColorOSNotifyIcon/blob/master/LICENSE)
|
[](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/fankes/ColorOSNotifyIcon/releases)
|
||||||
[](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
|
[](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
|
||||||
[](https://t.me/XiaofangInternet)
|
[](https://t.me/XiaofangInternet)
|
||||||
@@ -51,7 +51,7 @@ Optimize notification icons for ColorOS and adapt to native notification icon sp
|
|||||||
|
|
||||||
- [Automatic Build on Commit](https://github.com/fankes/ColorOSNotifyIcon/actions/workflows/commit_ci.yml)
|
- [Automatic Build on Commit](https://github.com/fankes/ColorOSNotifyIcon/actions/workflows/commit_ci.yml)
|
||||||
|
|
||||||
上述更新为代码 `commit` 后自动触发,具体更新内容可点击上方的文字前往 **Github Actions** 进行查看,本更新由开源的流程自动编译发布,**不保证其稳定性**,所发布的版本**仅供测试**,且不会特殊说明甚至可能会变更版本号或保持与当前稳定版相同的版本号。
|
上述更新为代码 `commit` 后自动触发,具体更新内容可点击上方的文字前往 **GitHub Actions** 进行查看,本更新由开源的流程自动编译发布,**不保证其稳定性**,所发布的版本**仅供测试**,且不会特殊说明甚至可能会变更版本号或保持与当前稳定版相同的版本号。
|
||||||
|
|
||||||
- [Release](https://github.com/fankes/ColorOSNotifyIcon/releases)
|
- [Release](https://github.com/fankes/ColorOSNotifyIcon/releases)
|
||||||
- [Xposed-Modules-Repo](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
|
- [Xposed-Modules-Repo](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
|
||||||
|
@@ -1,39 +1,51 @@
|
|||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
id 'com.google.devtools.ksp' version '1.7.22-1.0.8'
|
id 'com.google.devtools.ksp'
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 33
|
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
universal {
|
||||||
storeFile file('../keystore/public')
|
def dirPath = rootProject.ext.app.signingConfigs.secretConfigsDirPath
|
||||||
storePassword '123456'
|
def fileName = rootProject.ext.app.signingConfigs.secretConfigsFileName
|
||||||
keyAlias 'public'
|
def configs = new JsonSlurper().parse(file("${dirPath}/${fileName}"))
|
||||||
keyPassword '123456'
|
keyAlias configs.keyAlias
|
||||||
|
keyPassword configs.keyPassword
|
||||||
|
storeFile file("${dirPath}/${configs.storeFileName}")
|
||||||
|
storePassword configs.storePassword
|
||||||
v1SigningEnabled true
|
v1SigningEnabled true
|
||||||
v2SigningEnabled true
|
v2SigningEnabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
namespace 'com.fankes.coloros.notify'
|
||||||
applicationId "com.fankes.coloros.notify"
|
compileSdk rootProject.ext.android.compileSdk
|
||||||
minSdk 29
|
|
||||||
targetSdk 33
|
|
||||||
versionCode rootProject.ext.appVersionCode
|
|
||||||
versionName rootProject.ext.appVersionName
|
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
defaultConfig {
|
||||||
|
applicationId 'com.fankes.coloros.notify'
|
||||||
|
|
||||||
|
minSdk rootProject.ext.android.minSdk
|
||||||
|
targetSdk rootProject.ext.android.targetSdk
|
||||||
|
|
||||||
|
versionCode rootProject.ext.app.versionCode
|
||||||
|
versionName rootProject.ext.app.versionName
|
||||||
|
|
||||||
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
signingConfig signingConfigs.universal
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled rootProject.ext.enableR8
|
minifyEnabled true
|
||||||
shrinkResources rootProject.ext.enableR8
|
shrinkResources true
|
||||||
zipAlignEnabled rootProject.ext.enableR8
|
zipAlignEnabled true
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.universal
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,14 +72,14 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
compileOnly 'de.robv.android.xposed:api:82'
|
||||||
implementation 'com.highcapable.yukihookapi:api:1.1.8'
|
implementation 'com.highcapable.yukihookapi:api:1.1.9'
|
||||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.1.8'
|
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.1.9'
|
||||||
implementation 'com.github.duanhong169:drawabletoolbox:1.0.7'
|
implementation 'com.github.duanhong169:drawabletoolbox:1.0.7'
|
||||||
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
implementation "com.github.topjohnwu.libsu:core:5.0.4"
|
||||||
implementation 'androidx.annotation:annotation:1.5.0'
|
implementation 'androidx.annotation:annotation:1.6.0'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.7'
|
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.7'
|
||||||
implementation 'androidx.core:core-ktx:1.9.0'
|
implementation 'androidx.core:core-ktx:1.10.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
implementation 'com.google.android.material:material:1.8.0'
|
implementation 'com.google.android.material:material:1.8.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
@@ -39,10 +39,13 @@ object PackageName {
|
|||||||
*/
|
*/
|
||||||
object IconRuleSourceSyncType {
|
object IconRuleSourceSyncType {
|
||||||
|
|
||||||
/** Github Raw (代理) */
|
/** GitHub Raw (代理 - GitHub Proxy) */
|
||||||
const val GITHUB_RAW_PROXY = 1000
|
const val GITHUB_RAW_PROXY_1 = 500
|
||||||
|
|
||||||
/** Github Raw (直连) */
|
/** GitHub Raw (代理 - 7ED Services) */
|
||||||
|
const val GITHUB_RAW_PROXY_2 = 1000
|
||||||
|
|
||||||
|
/** GitHub Raw (直连) */
|
||||||
const val GITHUB_RAW_DIRECT = 2000
|
const val GITHUB_RAW_DIRECT = 2000
|
||||||
|
|
||||||
/** 自定义地址 */
|
/** 自定义地址 */
|
||||||
|
@@ -27,7 +27,7 @@ package com.fankes.coloros.notify.data
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.fankes.coloros.notify.const.IconRuleSourceSyncType
|
import com.fankes.coloros.notify.const.IconRuleSourceSyncType
|
||||||
import com.fankes.coloros.notify.utils.factory.isUpperOfAndroidS
|
import com.fankes.coloros.notify.utils.factory.isUpperOfAndroidS
|
||||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||||
import com.highcapable.yukihookapi.hook.log.loggerW
|
import com.highcapable.yukihookapi.hook.log.loggerW
|
||||||
import com.highcapable.yukihookapi.hook.param.PackageParam
|
import com.highcapable.yukihookapi.hook.param.PackageParam
|
||||||
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
||||||
@@ -61,6 +61,9 @@ object ConfigData {
|
|||||||
/** 通知栏中的通知图标圆角程度 */
|
/** 通知栏中的通知图标圆角程度 */
|
||||||
val NOTIFY_ICON_CORNER_SIZE = PrefsData("_notify_icon_corner", 15)
|
val NOTIFY_ICON_CORNER_SIZE = PrefsData("_notify_icon_corner", 15)
|
||||||
|
|
||||||
|
/** 强制通知栏中的通知图标使用系统着色 */
|
||||||
|
val ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR = PrefsData("_notify_icon_force_system_color", false)
|
||||||
|
|
||||||
/** 强制通知栏中的通知图标为 APP 图标 */
|
/** 强制通知栏中的通知图标为 APP 图标 */
|
||||||
val ENABLE_NOTIFY_ICON_FORCE_APP_ICON = PrefsData("_notify_icon_force_app_icon", false)
|
val ENABLE_NOTIFY_ICON_FORCE_APP_ICON = PrefsData("_notify_icon_force_app_icon", false)
|
||||||
|
|
||||||
@@ -68,7 +71,7 @@ object ConfigData {
|
|||||||
val ENABLE_NOTIFY_MEDIA_PANEL_AUTO_EXP = PrefsData("_enable_notify_media_panel_auto_exp", false)
|
val ENABLE_NOTIFY_MEDIA_PANEL_AUTO_EXP = PrefsData("_enable_notify_media_panel_auto_exp", false)
|
||||||
|
|
||||||
/** 启用自定义通知面板背景透明度 */
|
/** 启用自定义通知面板背景透明度 */
|
||||||
val ENABLE_NOTIFY_PANEL_ALPHA = PrefsData("_enable_notify_panel_alpha", false)
|
val ENABLE_NOTIFY_PANEL_ALPHA = PrefsData("_enable_notify_panel_alpha_pst", false)
|
||||||
|
|
||||||
/** 自定义通知面板背景透明度 */
|
/** 自定义通知面板背景透明度 */
|
||||||
val NOTIFY_PANEL_ALPHA_LEVEL = PrefsData("_notify_panel_alpha_pst", 75)
|
val NOTIFY_PANEL_ALPHA_LEVEL = PrefsData("_notify_panel_alpha_pst", 75)
|
||||||
@@ -92,7 +95,7 @@ object ConfigData {
|
|||||||
val NOTIFY_ICONS_DATA = PrefsData("_notify_icon_datas", "")
|
val NOTIFY_ICONS_DATA = PrefsData("_notify_icon_datas", "")
|
||||||
|
|
||||||
/** 通知图标优化名单同步方式 */
|
/** 通知图标优化名单同步方式 */
|
||||||
val ICON_RULE_SOURCE_SYNC_TYPE = PrefsData("_rule_source_sync_way", IconRuleSourceSyncType.GITHUB_RAW_PROXY)
|
val ICON_RULE_SOURCE_SYNC_TYPE = PrefsData("_rule_source_sync_way", IconRuleSourceSyncType.GITHUB_RAW_PROXY_1)
|
||||||
|
|
||||||
/** 通知图标优化名单同步地址 */
|
/** 通知图标优化名单同步地址 */
|
||||||
val ICON_RULE_SOURCE_SYNC_CUSTOM_URL = PrefsData("_rule_source_sync_way_custom_url", "")
|
val ICON_RULE_SOURCE_SYNC_CUSTOM_URL = PrefsData("_rule_source_sync_way_custom_url", "")
|
||||||
@@ -118,7 +121,7 @@ object ConfigData {
|
|||||||
* @return [String]
|
* @return [String]
|
||||||
*/
|
*/
|
||||||
private fun getString(data: PrefsData<String>) = when (instance) {
|
private fun getString(data: PrefsData<String>) = when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.get(data)
|
is Context -> (instance as Context).prefs().get(data)
|
||||||
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
||||||
else -> error("Unknown type for get prefs data")
|
else -> error("Unknown type for get prefs data")
|
||||||
}
|
}
|
||||||
@@ -130,7 +133,7 @@ object ConfigData {
|
|||||||
*/
|
*/
|
||||||
private fun putString(data: PrefsData<String>, value: String) {
|
private fun putString(data: PrefsData<String>, value: String) {
|
||||||
when (instance) {
|
when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.put(data, value)
|
is Context -> (instance as Context).prefs().edit { put(data, value) }
|
||||||
is PackageParam -> loggerW(msg = "Not support for this method")
|
is PackageParam -> loggerW(msg = "Not support for this method")
|
||||||
else -> error("Unknown type for put prefs data")
|
else -> error("Unknown type for put prefs data")
|
||||||
}
|
}
|
||||||
@@ -142,7 +145,7 @@ object ConfigData {
|
|||||||
* @return [Int]
|
* @return [Int]
|
||||||
*/
|
*/
|
||||||
internal fun getInt(data: PrefsData<Int>) = when (instance) {
|
internal fun getInt(data: PrefsData<Int>) = when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.get(data)
|
is Context -> (instance as Context).prefs().get(data)
|
||||||
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
||||||
else -> error("Unknown type for get prefs data")
|
else -> error("Unknown type for get prefs data")
|
||||||
}
|
}
|
||||||
@@ -154,7 +157,7 @@ object ConfigData {
|
|||||||
*/
|
*/
|
||||||
internal fun putInt(data: PrefsData<Int>, value: Int) {
|
internal fun putInt(data: PrefsData<Int>, value: Int) {
|
||||||
when (instance) {
|
when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.put(data, value)
|
is Context -> (instance as Context).prefs().edit { put(data, value) }
|
||||||
is PackageParam -> loggerW(msg = "Not support for this method")
|
is PackageParam -> loggerW(msg = "Not support for this method")
|
||||||
else -> error("Unknown type for put prefs data")
|
else -> error("Unknown type for put prefs data")
|
||||||
}
|
}
|
||||||
@@ -166,7 +169,7 @@ object ConfigData {
|
|||||||
* @return [Boolean]
|
* @return [Boolean]
|
||||||
*/
|
*/
|
||||||
internal fun getBoolean(data: PrefsData<Boolean>) = when (instance) {
|
internal fun getBoolean(data: PrefsData<Boolean>) = when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.get(data)
|
is Context -> (instance as Context).prefs().get(data)
|
||||||
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
is PackageParam -> (instance as PackageParam).prefs.get(data)
|
||||||
else -> error("Unknown type for get prefs data")
|
else -> error("Unknown type for get prefs data")
|
||||||
}
|
}
|
||||||
@@ -178,7 +181,7 @@ object ConfigData {
|
|||||||
*/
|
*/
|
||||||
internal fun putBoolean(data: PrefsData<Boolean>, value: Boolean) {
|
internal fun putBoolean(data: PrefsData<Boolean>, value: Boolean) {
|
||||||
when (instance) {
|
when (instance) {
|
||||||
is Context -> (instance as Context).modulePrefs.put(data, value)
|
is Context -> (instance as Context).prefs().edit { put(data, value) }
|
||||||
is PackageParam -> loggerW(msg = "Not support for this method")
|
is PackageParam -> loggerW(msg = "Not support for this method")
|
||||||
else -> error("Unknown type for put prefs data")
|
else -> error("Unknown type for put prefs data")
|
||||||
}
|
}
|
||||||
@@ -264,6 +267,16 @@ object ConfigData {
|
|||||||
putInt(NOTIFY_ICON_CORNER_SIZE, value)
|
putInt(NOTIFY_ICON_CORNER_SIZE, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否强制通知栏中的通知图标使用系统着色
|
||||||
|
* @return [Boolean]
|
||||||
|
*/
|
||||||
|
var isEnableNotifyIconForceSystemColor
|
||||||
|
get() = getBoolean(ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR)
|
||||||
|
set(value) {
|
||||||
|
putBoolean(ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR, value)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否强制通知栏中的通知图标为 APP 图标
|
* 是否强制通知栏中的通知图标为 APP 图标
|
||||||
* @return [Boolean]
|
* @return [Boolean]
|
||||||
|
@@ -52,6 +52,7 @@ import com.fankes.coloros.notify.param.IconPackParams
|
|||||||
import com.fankes.coloros.notify.param.factory.isAppNotifyHookAllOf
|
import com.fankes.coloros.notify.param.factory.isAppNotifyHookAllOf
|
||||||
import com.fankes.coloros.notify.param.factory.isAppNotifyHookOf
|
import com.fankes.coloros.notify.param.factory.isAppNotifyHookOf
|
||||||
import com.fankes.coloros.notify.utils.factory.*
|
import com.fankes.coloros.notify.utils.factory.*
|
||||||
|
import com.fankes.coloros.notify.utils.tool.ActivationPromptTool
|
||||||
import com.fankes.coloros.notify.utils.tool.BitmapCompatTool
|
import com.fankes.coloros.notify.utils.tool.BitmapCompatTool
|
||||||
import com.fankes.coloros.notify.utils.tool.IconAdaptationTool
|
import com.fankes.coloros.notify.utils.tool.IconAdaptationTool
|
||||||
import com.fankes.coloros.notify.utils.tool.SystemUITool
|
import com.fankes.coloros.notify.utils.tool.SystemUITool
|
||||||
@@ -141,7 +142,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
/** 根据多个版本存在不同的包名相同的类 */
|
/** 根据多个版本存在不同的包名相同的类 */
|
||||||
private val RoundRectDrawableUtil_CompanionClass = VariousClass(
|
private val RoundRectDrawableUtil_CompanionClass = VariousClass(
|
||||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion",
|
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion",
|
||||||
"com.oplusos.systemui.notification.util.RoundRectDrawableUtil\$Companion"
|
"com.coloros.systemui.notification.util.RoundRectDrawableUtil\$Companion"
|
||||||
)
|
)
|
||||||
|
|
||||||
/** 根据多个版本存在不同的包名相同的类 */
|
/** 根据多个版本存在不同的包名相同的类 */
|
||||||
@@ -198,6 +199,12 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
/** 通知栏通知控制器 */
|
/** 通知栏通知控制器 */
|
||||||
private var notificationPresenter: Any? = null
|
private var notificationPresenter: Any? = null
|
||||||
|
|
||||||
|
/** 通知面板默认背景着色 [ColorStateList] */
|
||||||
|
private var defaultNotifyPanelTintList: ColorStateList? = null
|
||||||
|
|
||||||
|
/** 通知面板默认背景阴影效果强度 */
|
||||||
|
private var defaultNotifyPanelElevation = -1f
|
||||||
|
|
||||||
/** 仅监听一次主题壁纸颜色变化 */
|
/** 仅监听一次主题壁纸颜色变化 */
|
||||||
private var isWallpaperColorListenerSetUp = false
|
private var isWallpaperColorListenerSetUp = false
|
||||||
|
|
||||||
@@ -369,7 +376,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isGrayscaleIcon.not() && ConfigData.isEnableNotifyIconFixPlaceholder)
|
if (isGrayscaleIcon.not() && ConfigData.isEnableNotifyIconFixPlaceholder)
|
||||||
customPair = Triple(context.resources.drawableOf(R.drawable.ic_unsupported), 0, true)
|
customPair = Triple(context.resources.drawableOf(R.drawable.ic_message), 0, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return customPair ?: Triple(null, 0, false)
|
return customPair ?: Triple(null, 0, false)
|
||||||
@@ -416,43 +423,40 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
iconView: ImageView
|
iconView: ImageView
|
||||||
) = runInSafe {
|
) = runInSafe {
|
||||||
compatCustomIcon(context, isGrayscaleIcon, packageName).also { customTriple ->
|
compatCustomIcon(context, isGrayscaleIcon, packageName).also { customTriple ->
|
||||||
/** 设置一个用于替换的图标 */
|
|
||||||
val placeholderView = ImageView(context)
|
|
||||||
/** 克隆之前图标的所有布局信息 */
|
|
||||||
(iconView.parent as? ViewGroup?)?.apply { addView(placeholderView.apply { layoutParams = iconView.layoutParams }) }
|
|
||||||
?: loggerE(msg = "Cannot got the orginal notification icon's parent view \"${nf.packageName}\"(\"${nf.opPkg}\") of $nf")
|
|
||||||
/** 将之前图标的间距设置为一个超大值以达到隐藏的效果 */
|
|
||||||
999.also { iconView.setPadding(it, it, it, it) }
|
|
||||||
/** 清除之前图标可能存在的背景 */
|
|
||||||
iconView.background = null
|
|
||||||
when {
|
when {
|
||||||
ConfigData.isEnableNotifyIconForceAppIcon -> placeholderView.apply {
|
ConfigData.isEnableNotifyIconForceAppIcon -> iconView.apply {
|
||||||
/** 重新设置图标 */
|
/** 重新设置图标 */
|
||||||
setImageDrawable(appIcons[packageName] ?: context.appIconOf(packageName))
|
setImageDrawable(appIcons[packageName] ?: context.appIconOf(packageName))
|
||||||
/** 设置默认样式 */
|
/** 设置默认样式 */
|
||||||
setDefaultNotifyIconViewStyle()
|
setDefaultNotifyIconViewStyle()
|
||||||
}
|
}
|
||||||
(customTriple.first != null && customTriple.third.not()) || isGrayscaleIcon -> placeholderView.apply {
|
(customTriple.first != null && customTriple.third.not()) || isGrayscaleIcon -> iconView.apply {
|
||||||
/** 设置不要裁切到边界 */
|
/** 设置不要裁切到边界 */
|
||||||
clipToOutline = false
|
clipToOutline = false
|
||||||
/** 重新设置图标 */
|
/** 重新设置图标 */
|
||||||
setImageDrawable(customTriple.first ?: drawable)
|
setImageDrawable(customTriple.first ?: drawable)
|
||||||
|
|
||||||
/** 旧版风格 */
|
/** 旧版风格 */
|
||||||
val oldStyle = (if (context.isSystemInDarkMode) 0xffdcdcdc else 0xff707173).toInt()
|
val oldStyle = if (context.isSystemInDarkMode) 0xFFDCDCDC.toInt() else 0xFF707173.toInt()
|
||||||
|
|
||||||
/** 新版风格 */
|
/** 新版风格 */
|
||||||
val newStyle = (if (context.isSystemInDarkMode) 0xffdcdcdc else Color.WHITE).toInt()
|
val newStyle = if (context.isSystemInDarkMode) 0xFFDCDCDC.toInt() else Color.WHITE
|
||||||
|
|
||||||
/** 原生着色 */
|
/** 原生着色 */
|
||||||
val md3Style = if (isUpperOfAndroidS) context.systemAccentColor else
|
val md3Style = if (isUpperOfAndroidS) context.systemAccentColor else
|
||||||
(if (context.isSystemInDarkMode) 0xff707173 else oldStyle).toInt()
|
(if (context.isSystemInDarkMode) 0xFF707173.toInt() else oldStyle)
|
||||||
|
|
||||||
|
/** 原生通知图标颜色 */
|
||||||
|
val nativeIconColor = if (ConfigData.isEnableNotifyIconForceSystemColor) 0 else iconColor
|
||||||
|
|
||||||
|
/** 自定义通知图标颜色 */
|
||||||
|
val customIconColor = if (ConfigData.isEnableNotifyIconForceSystemColor) 0 else customTriple.second
|
||||||
|
|
||||||
/** 旧版图标着色 */
|
/** 旧版图标着色 */
|
||||||
val oldApplyColor = customTriple.second.takeIf { it != 0 } ?: iconColor.takeIf { it != 0 } ?: oldStyle
|
val oldApplyColor = customIconColor.takeIf { it != 0 } ?: nativeIconColor.takeIf { it != 0 } ?: oldStyle
|
||||||
|
|
||||||
/** 新版图标着色 */
|
/** 新版图标着色 */
|
||||||
val newApplyColor = customTriple.second.takeIf { it != 0 } ?: iconColor.takeIf { it != 0 } ?: md3Style
|
val newApplyColor = customIconColor.takeIf { it != 0 } ?: nativeIconColor.takeIf { it != 0 } ?: md3Style
|
||||||
|
|
||||||
/** 判断风格并开始 Hook */
|
/** 判断风格并开始 Hook */
|
||||||
if (ConfigData.isEnableMd3NotifyIconStyle) {
|
if (ConfigData.isEnableMd3NotifyIconStyle) {
|
||||||
@@ -470,7 +474,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
setPadding(0, 0, 0, 0)
|
setPadding(0, 0, 0, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> placeholderView.apply {
|
else -> iconView.apply {
|
||||||
/** 重新设置图标 */
|
/** 重新设置图标 */
|
||||||
setImageDrawable(nf.compatPushingIcon(drawable))
|
setImageDrawable(nf.compatPushingIcon(drawable))
|
||||||
/** 设置默认样式 */
|
/** 设置默认样式 */
|
||||||
@@ -491,25 +495,28 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
* @param isTint 是否着色 [view]
|
* @param isTint 是否着色 [view]
|
||||||
*/
|
*/
|
||||||
private fun modifyNotifyPanelAlpha(view: View?, drawable: Drawable? = null, isTint: Boolean = false) {
|
private fun modifyNotifyPanelAlpha(view: View?, drawable: Drawable? = null, isTint: Boolean = false) {
|
||||||
|
if (view == null) return
|
||||||
|
if (defaultNotifyPanelTintList == null) defaultNotifyPanelTintList = view.backgroundTintList
|
||||||
|
if (defaultNotifyPanelElevation < 0f) defaultNotifyPanelElevation = view.elevation
|
||||||
val isEnable = ConfigData.isEnableNotifyPanelAlpha
|
val isEnable = ConfigData.isEnableNotifyPanelAlpha
|
||||||
val currentAlpha = ConfigData.notifyPanelAlphaLevel
|
val currentAlpha = ConfigData.notifyPanelAlphaLevel
|
||||||
val currendColor = if (view?.context?.isSystemInDarkMode == true) 0xFF404040.toInt() else 0xFFFAFAFA.toInt()
|
val currentColor = if (view.context?.isSystemInDarkMode == true) 0xFF404040.toInt() else 0xFFFAFAFA.toInt()
|
||||||
/** 设置通知面板背景透明度 */
|
/** 设置通知面板背景透明度 */
|
||||||
when {
|
when {
|
||||||
isEnable.not() -> {
|
isEnable.not() -> {
|
||||||
if (isTint) view?.backgroundTintList = ColorStateList.valueOf(currendColor)
|
if (isTint) view.backgroundTintList = defaultNotifyPanelTintList
|
||||||
else drawable?.setTint(currendColor)
|
else drawable?.setTintList(defaultNotifyPanelTintList)
|
||||||
}
|
}
|
||||||
isTint.not() && view?.parent?.parent?.javaClass?.name?.contains("ChildrenContainer") == true -> drawable?.alpha = 0
|
isTint.not() && view.parent?.parent?.javaClass?.name?.contains("ChildrenContainer") == true -> drawable?.alpha = 0
|
||||||
else -> {
|
else -> {
|
||||||
currendColor.colorAlphaOf(currentAlpha / 100f).also {
|
currentColor.colorAlphaOf(currentAlpha / 100f).also {
|
||||||
if (isTint) view?.backgroundTintList = ColorStateList.valueOf(it)
|
if (isTint) view.backgroundTintList = ColorStateList.valueOf(it)
|
||||||
else drawable?.setTint(it)
|
else drawable?.setTint(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 移除阴影效果 */
|
/** 移除阴影效果 */
|
||||||
if (isEnable) view?.elevation = 0f
|
view.elevation = if (isEnable) 0f else defaultNotifyPanelElevation
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 设置默认通知栏通知图标样式 */
|
/** 设置默认通知栏通知图标样式 */
|
||||||
@@ -550,11 +557,12 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
addAction(Intent.ACTION_PACKAGE_REPLACED)
|
addAction(Intent.ACTION_PACKAGE_REPLACED)
|
||||||
addAction(Intent.ACTION_PACKAGE_REMOVED)
|
addAction(Intent.ACTION_PACKAGE_REMOVED)
|
||||||
}) { context, intent ->
|
}) { context, intent ->
|
||||||
if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED).not() &&
|
intent.data?.schemeSpecificPart?.also { packageName ->
|
||||||
intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)
|
if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED)) ActivationPromptTool.prompt(context, packageName)
|
||||||
) return@registerReceiver
|
if (intent.action.equals(Intent.ACTION_PACKAGE_REPLACED).not() &&
|
||||||
if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify)
|
intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)
|
||||||
intent.data?.schemeSpecificPart?.also { packageName ->
|
) return@registerReceiver
|
||||||
|
if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify)
|
||||||
when (intent.action) {
|
when (intent.action) {
|
||||||
Intent.ACTION_PACKAGE_ADDED -> {
|
Intent.ACTION_PACKAGE_ADDED -> {
|
||||||
if (iconDatas.takeIf { e -> e.isNotEmpty() }
|
if (iconDatas.takeIf { e -> e.isNotEmpty() }
|
||||||
@@ -564,7 +572,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
Intent.ACTION_PACKAGE_REMOVED -> IconAdaptationTool.removeNewAppSupportNotify(context, packageName)
|
Intent.ACTION_PACKAGE_REMOVED -> IconAdaptationTool.removeNewAppSupportNotify(context, packageName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 注入模块资源 */
|
/** 注入模块资源 */
|
||||||
onCreate { injectModuleAppResources() }
|
onCreate { injectModuleAppResources() }
|
||||||
@@ -630,7 +638,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
DndAlertHelperClass.hook {
|
DndAlertHelperClass.hook {
|
||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "sendNotificationWithEndtime"
|
name { it.lowercase() == "sendnotificationwithendtime" }
|
||||||
param(LongType)
|
param(LongType)
|
||||||
}
|
}
|
||||||
beforeHook {
|
beforeHook {
|
||||||
@@ -639,15 +647,22 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 修复并替换新版本 ColorOS 原生灰度图标色彩判断 */
|
/** 修复并替换 ColorOS 以及原生灰度图标色彩判断 */
|
||||||
NotificationUtilsClass.hook {
|
NotificationUtilsClass.hook {
|
||||||
|
injectMember {
|
||||||
|
method {
|
||||||
|
name = "isGrayscale"
|
||||||
|
param(ImageViewClass, ContrastColorUtilClass)
|
||||||
|
}
|
||||||
|
replaceAny { args().first().cast<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } ?: callOriginal() }
|
||||||
|
}
|
||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "isGrayscaleOplus"
|
name = "isGrayscaleOplus"
|
||||||
param(ImageViewClass, OplusContrastColorUtilClass)
|
param(ImageViewClass, OplusContrastColorUtilClass)
|
||||||
}
|
}
|
||||||
replaceAny { args().first().cast<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } ?: callOriginal() }
|
replaceAny { args().first().cast<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } ?: callOriginal() }
|
||||||
}.ignoredHookingFailure()
|
}.ignoredNoSuchMemberFailure()
|
||||||
}
|
}
|
||||||
/** 替换状态栏图标 */
|
/** 替换状态栏图标 */
|
||||||
IconManagerClass.hook {
|
IconManagerClass.hook {
|
||||||
@@ -748,7 +763,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||||
}
|
}
|
||||||
}.by { isOldNotificationBackground.not() }
|
}.ignoredHookClassNotFoundFailure().by { isOldNotificationBackground.not() }
|
||||||
/** 替换通知面板背景 - 旧版本 */
|
/** 替换通知面板背景 - 旧版本 */
|
||||||
NotificationBackgroundViewClass.hook {
|
NotificationBackgroundViewClass.hook {
|
||||||
injectMember {
|
injectMember {
|
||||||
@@ -764,7 +779,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
paramCount = 2
|
paramCount = 2
|
||||||
}
|
}
|
||||||
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
|
||||||
}
|
}.ignoredNoSuchMemberFailure()
|
||||||
}.by { isOldNotificationBackground }
|
}.by { isOldNotificationBackground }
|
||||||
/** 替换通知面板背景 - 避免折叠展开通知二次修改通知面板背景 */
|
/** 替换通知面板背景 - 避免折叠展开通知二次修改通知面板背景 */
|
||||||
ExpandableNotificationRowClass.hook {
|
ExpandableNotificationRowClass.hook {
|
||||||
@@ -822,7 +837,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
/** 替换通知图标和样式 */
|
/** 替换通知图标和样式 */
|
||||||
NotificationHeaderViewWrapperClass.hook {
|
NotificationHeaderViewWrapperClass.hook {
|
||||||
injectMember {
|
injectMember {
|
||||||
method { name = "resolveHeaderViews" }
|
method { name { it == "resolveHeaderViews" || it == "onContentUpdated" } }.all()
|
||||||
afterHook {
|
afterHook {
|
||||||
NotificationHeaderViewWrapperClass.toClass()
|
NotificationHeaderViewWrapperClass.toClass()
|
||||||
.field { name = "mIcon" }.get(instance).cast<ImageView>()?.apply {
|
.field { name = "mIcon" }.get(instance).cast<ImageView>()?.apply {
|
||||||
@@ -837,15 +852,21 @@ object SystemUIHooker : YukiBaseHooker() {
|
|||||||
}.also { nf ->
|
}.also { nf ->
|
||||||
nf?.notification?.also {
|
nf?.notification?.also {
|
||||||
it.smallIcon.loadDrawable(context)?.also { iconDrawable ->
|
it.smallIcon.loadDrawable(context)?.also { iconDrawable ->
|
||||||
compatNotifyIcon(
|
/** 执行替换 */
|
||||||
context = context,
|
fun doParse() {
|
||||||
nf = nf,
|
compatNotifyIcon(
|
||||||
isGrayscaleIcon = isGrayscaleIcon(context, iconDrawable),
|
context = context,
|
||||||
packageName = context.packageName,
|
nf = nf,
|
||||||
drawable = iconDrawable,
|
isGrayscaleIcon = isGrayscaleIcon(context, iconDrawable),
|
||||||
iconColor = it.color,
|
packageName = context.packageName,
|
||||||
iconView = this
|
drawable = iconDrawable,
|
||||||
)
|
iconColor = it.color,
|
||||||
|
iconView = this
|
||||||
|
)
|
||||||
|
}
|
||||||
|
doParse()
|
||||||
|
/** 延迟重新设置防止部分机型的系统重新设置图标出现图标着色后黑白块问题 */
|
||||||
|
delayedRun(ms = 1500) { doParse() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ import android.graphics.Color
|
|||||||
import com.fankes.coloros.notify.bean.IconDataBean
|
import com.fankes.coloros.notify.bean.IconDataBean
|
||||||
import com.fankes.coloros.notify.data.ConfigData
|
import com.fankes.coloros.notify.data.ConfigData
|
||||||
import com.fankes.coloros.notify.utils.factory.*
|
import com.fankes.coloros.notify.utils.factory.*
|
||||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||||
import com.highcapable.yukihookapi.hook.param.PackageParam
|
import com.highcapable.yukihookapi.hook.param.PackageParam
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
@@ -47,7 +47,7 @@ class IconPackParams(private val context: Context? = null, private val param: Pa
|
|||||||
* 已存储的 JSON 数据
|
* 已存储的 JSON 数据
|
||||||
* @return [String]
|
* @return [String]
|
||||||
*/
|
*/
|
||||||
internal val storageDataJson get() = (context?.modulePrefs ?: param?.prefs)?.direct()?.get(ConfigData.NOTIFY_ICONS_DATA)
|
internal val storageDataJson get() = (context?.prefs() ?: param?.prefs)?.direct()?.get(ConfigData.NOTIFY_ICONS_DATA)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取图标数据
|
* 获取图标数据
|
||||||
@@ -134,5 +134,5 @@ class IconPackParams(private val context: Context? = null, private val param: Pa
|
|||||||
* 保存图标数据
|
* 保存图标数据
|
||||||
* @param dataJson 图标数据 JSON
|
* @param dataJson 图标数据 JSON
|
||||||
*/
|
*/
|
||||||
fun save(dataJson: String) = context?.modulePrefs?.put(ConfigData.NOTIFY_ICONS_DATA, dataJson)
|
fun save(dataJson: String) = context?.prefs()?.edit { put(ConfigData.NOTIFY_ICONS_DATA, dataJson) }
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ package com.fankes.coloros.notify.param.factory
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.fankes.coloros.notify.bean.IconDataBean
|
import com.fankes.coloros.notify.bean.IconDataBean
|
||||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||||
import com.highcapable.yukihookapi.hook.param.PackageParam
|
import com.highcapable.yukihookapi.hook.param.PackageParam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,14 +38,14 @@ fun PackageParam.isAppNotifyHookOf(bean: IconDataBean) = prefs.getBoolean(bean.t
|
|||||||
* 获取此 APP 的通知图标是否被 Hook
|
* 获取此 APP 的通知图标是否被 Hook
|
||||||
* @param bean 图标 bean
|
* @param bean 图标 bean
|
||||||
*/
|
*/
|
||||||
fun Context.isAppNotifyHookOf(bean: IconDataBean) = modulePrefs.getBoolean(bean.toEnabledName(), bean.isEnabled)
|
fun Context.isAppNotifyHookOf(bean: IconDataBean) = prefs().getBoolean(bean.toEnabledName(), bean.isEnabled)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置 Hook 此 APP 的通知图标
|
* 设置 Hook 此 APP 的通知图标
|
||||||
* @param bean 图标 bean
|
* @param bean 图标 bean
|
||||||
* @param isHook 是否 Hook
|
* @param isHook 是否 Hook
|
||||||
*/
|
*/
|
||||||
fun Context.putAppNotifyHookOf(bean: IconDataBean, isHook: Boolean) = modulePrefs.putBoolean(bean.toEnabledName(), isHook)
|
fun Context.putAppNotifyHookOf(bean: IconDataBean, isHook: Boolean) = prefs().edit { putBoolean(bean.toEnabledName(), isHook) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取此 APP 的通知图标是否被全部 Hook
|
* 获取此 APP 的通知图标是否被全部 Hook
|
||||||
@@ -57,11 +57,11 @@ fun PackageParam.isAppNotifyHookAllOf(bean: IconDataBean) = prefs.getBoolean(bea
|
|||||||
* 获取此 APP 的通知图标是否被全部 Hook
|
* 获取此 APP 的通知图标是否被全部 Hook
|
||||||
* @param bean 图标 bean
|
* @param bean 图标 bean
|
||||||
*/
|
*/
|
||||||
fun Context.isAppNotifyHookAllOf(bean: IconDataBean) = modulePrefs.getBoolean(bean.toEnabledAllName(), bean.isEnabledAll)
|
fun Context.isAppNotifyHookAllOf(bean: IconDataBean) = prefs().getBoolean(bean.toEnabledAllName(), bean.isEnabledAll)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置全部 Hook 此 APP 的通知图标
|
* 设置全部 Hook 此 APP 的通知图标
|
||||||
* @param bean 图标 bean
|
* @param bean 图标 bean
|
||||||
* @param isHook 是否 Hook
|
* @param isHook 是否 Hook
|
||||||
*/
|
*/
|
||||||
fun Context.putAppNotifyHookAllOf(bean: IconDataBean, isHook: Boolean) = modulePrefs.putBoolean(bean.toEnabledAllName(), isHook)
|
fun Context.putAppNotifyHookAllOf(bean: IconDataBean, isHook: Boolean) = prefs().edit { putBoolean(bean.toEnabledAllName(), isHook) }
|
@@ -124,6 +124,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
binding.notifyMediaPanelAutoExpSwitch.isVisible = false
|
binding.notifyMediaPanelAutoExpSwitch.isVisible = false
|
||||||
binding.notifyMediaPanelAutoExpText.isVisible = false
|
binding.notifyMediaPanelAutoExpText.isVisible = false
|
||||||
}
|
}
|
||||||
|
/** 通知面板背景透明度功能仅支持 ColorOS 12、12.1、13 */
|
||||||
|
binding.notifyPanelConfigItem.isVisible = colorOSNumberVersion.let { it == "V12" || it == "V12.1" || it == "V13" }
|
||||||
binding.notifyIconAutoSyncText.text = ConfigData.notifyIconFixAutoTime
|
binding.notifyIconAutoSyncText.text = ConfigData.notifyIconFixAutoTime
|
||||||
binding.moduleEnableSwitch.bind(ConfigData.ENABLE_MODULE) {
|
binding.moduleEnableSwitch.bind(ConfigData.ENABLE_MODULE) {
|
||||||
onInitialize {
|
onInitialize {
|
||||||
@@ -181,9 +183,30 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
SystemUITool.refreshSystemUI(context = this@MainActivity)
|
SystemUITool.refreshSystemUI(context = this@MainActivity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
binding.notifyIconForceSystemColorSwitch.bind(ConfigData.ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR) {
|
||||||
|
isAutoApplyChanges = false
|
||||||
|
onChanged {
|
||||||
|
/** 应用更改并刷新系统界面 */
|
||||||
|
fun applyChangesAndRefresh() {
|
||||||
|
applyChangesAndReinitialize()
|
||||||
|
SystemUITool.refreshSystemUI(context = this@MainActivity)
|
||||||
|
}
|
||||||
|
if (it) showDialog {
|
||||||
|
title = "破坏性功能警告"
|
||||||
|
msg = "开启这个功能后,任何通知栏中的通知图标都会忽略图标自身的着色属性,全部使用系统默认颜色 (系统提供的统一色调) 着色。\n\n" +
|
||||||
|
"此功能仅面向一些追求图标美观度的用户,我们不推荐开启这个功能,且发生任何 BUG 都不会去修复,仍然继续开启吗?"
|
||||||
|
confirmButton { applyChangesAndRefresh() }
|
||||||
|
cancelButton { cancelChanges() }
|
||||||
|
noCancelable()
|
||||||
|
} else applyChangesAndRefresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
binding.notifyIconForceAppIconSwitch.bind(ConfigData.ENABLE_NOTIFY_ICON_FORCE_APP_ICON) {
|
binding.notifyIconForceAppIconSwitch.bind(ConfigData.ENABLE_NOTIFY_ICON_FORCE_APP_ICON) {
|
||||||
isAutoApplyChanges = false
|
isAutoApplyChanges = false
|
||||||
onInitialize { binding.notifyIconCustomCornerItem.isVisible = it.not() && ConfigData.isEnableMd3NotifyIconStyle }
|
onInitialize {
|
||||||
|
binding.notifyIconForceSystemColorItem.isVisible = it.not()
|
||||||
|
binding.notifyIconCustomCornerItem.isVisible = it.not() && ConfigData.isEnableMd3NotifyIconStyle
|
||||||
|
}
|
||||||
onChanged {
|
onChanged {
|
||||||
/** 应用更改并刷新系统界面 */
|
/** 应用更改并刷新系统界面 */
|
||||||
fun applyChangesAndRefresh() {
|
fun applyChangesAndRefresh() {
|
||||||
|
@@ -338,12 +338,12 @@ val Context.systemAccentColor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统壁纸颜色
|
* 获取系统壁纸颜色
|
||||||
* @return [Int] 无法获取时返回透明色
|
* @return [Int] 无法获取时返回默认颜色
|
||||||
*/
|
*/
|
||||||
val Context.wallpaperColor
|
val Context.wallpaperColor
|
||||||
get() = safeOfNan {
|
get() = runCatching {
|
||||||
WallpaperManager.getInstance(this).getWallpaperColors(WallpaperManager.FLAG_SYSTEM)?.primaryColor?.toArgb() ?: 0
|
WallpaperManager.getInstance(this).getWallpaperColors(WallpaperManager.FLAG_SYSTEM)?.primaryColor?.toArgb()
|
||||||
}
|
}.getOrNull() ?: (if (isSystemInDarkMode) 0xFFD8D8D8.toInt() else 0xFF707173.toInt())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否为白色
|
* 是否为白色
|
||||||
|
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* ColorOSNotifyIcon - Optimize notification icons for ColorOS and adapt to native notification icon specifications.
|
||||||
|
* Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
|
||||||
|
* https://github.com/fankes/ColorOSNotifyIcon
|
||||||
|
*
|
||||||
|
* This software is non-free but opensource software: you can redistribute it
|
||||||
|
* and/or modify it under the terms of the GNU Affero General Public License
|
||||||
|
* as published by the Free Software Foundation; either
|
||||||
|
* version 3 of the License, or any later version.
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* and eula along with this software. If not, see
|
||||||
|
* <https://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
* This file is Created by fankes on 2023/4/17.
|
||||||
|
*/
|
||||||
|
package com.fankes.coloros.notify.utils.tool
|
||||||
|
|
||||||
|
import android.app.Notification
|
||||||
|
import android.app.NotificationChannel
|
||||||
|
import android.app.NotificationManager
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.content.ComponentName
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.drawable.Icon
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.core.graphics.drawable.toBitmap
|
||||||
|
import com.fankes.coloros.notify.BuildConfig
|
||||||
|
import com.fankes.coloros.notify.R
|
||||||
|
import com.fankes.coloros.notify.utils.factory.appIconOf
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块更新激活提醒通知工具类
|
||||||
|
*/
|
||||||
|
object ActivationPromptTool {
|
||||||
|
|
||||||
|
/** 当前模块的包名 */
|
||||||
|
private const val MODULE_PACKAGE_NAME = BuildConfig.APPLICATION_ID
|
||||||
|
|
||||||
|
/** 推送通知的渠道名称 */
|
||||||
|
private const val NOTIFY_CHANNEL = "activationPromptId"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送提醒通知
|
||||||
|
* @param context 当前实例
|
||||||
|
* @param packageName 当前 APP 包名
|
||||||
|
*/
|
||||||
|
fun prompt(context: Context, packageName: String) {
|
||||||
|
if (packageName != BuildConfig.APPLICATION_ID) return
|
||||||
|
context.getSystemService(NotificationManager::class.java)?.apply {
|
||||||
|
createNotificationChannel(
|
||||||
|
NotificationChannel(
|
||||||
|
NOTIFY_CHANNEL, "ColorOS 通知图标增强 - 版本更新",
|
||||||
|
NotificationManager.IMPORTANCE_DEFAULT
|
||||||
|
).apply { enableLights(false) }
|
||||||
|
)
|
||||||
|
notify(packageName.hashCode(), Notification.Builder(context, NOTIFY_CHANNEL).apply {
|
||||||
|
setShowWhen(true)
|
||||||
|
setContentTitle("模块已更新")
|
||||||
|
setContentText("点按通知打开模块以完成新版本激活。")
|
||||||
|
setColor(0xFF4E8A5A.toInt())
|
||||||
|
setAutoCancel(true)
|
||||||
|
setSmallIcon(Icon.createWithResource(MODULE_PACKAGE_NAME, R.drawable.ic_notify_update))
|
||||||
|
setLargeIcon(context.appIconOf(packageName)?.toBitmap())
|
||||||
|
setContentIntent(
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
context, packageName.hashCode(),
|
||||||
|
Intent().apply {
|
||||||
|
component = ComponentName(MODULE_PACKAGE_NAME, "${MODULE_PACKAGE_NAME}.ui.activity.MainActivity")
|
||||||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
}, if (Build.VERSION.SDK_INT < 31) PendingIntent.FLAG_UPDATE_CURRENT else PendingIntent.FLAG_IMMUTABLE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}.build())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -35,7 +35,7 @@ import java.io.Serializable
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 Github Release 最新版本工具类
|
* 获取 GitHub Release 最新版本工具类
|
||||||
*/
|
*/
|
||||||
object GithubReleaseTool {
|
object GithubReleaseTool {
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ object GithubReleaseTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Github Release bean
|
* GitHub Release bean
|
||||||
* @param name 版本名称
|
* @param name 版本名称
|
||||||
* @param htmlUrl 网页地址
|
* @param htmlUrl 网页地址
|
||||||
* @param content 更新日志
|
* @param content 更新日志
|
||||||
|
@@ -24,7 +24,7 @@ package com.fankes.coloros.notify.utils.tool
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.fankes.coloros.notify.utils.factory.showDialog
|
import com.fankes.coloros.notify.utils.factory.showDialog
|
||||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||||
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@@ -41,8 +41,8 @@ object I18nWarnTool {
|
|||||||
* @param context 实例
|
* @param context 实例
|
||||||
*/
|
*/
|
||||||
fun checkingOrShowing(context: Context) {
|
fun checkingOrShowing(context: Context) {
|
||||||
fun saveReaded() = context.modulePrefs.put(LOCALE_WARN_READED, value = true)
|
fun saveReaded() = context.prefs().edit { put(LOCALE_WARN_READED, value = true) }
|
||||||
if (Locale.getDefault().language.startsWith("zh").not() && context.modulePrefs.get(LOCALE_WARN_READED).not())
|
if (Locale.getDefault().language.startsWith("zh").not() && context.prefs().get(LOCALE_WARN_READED).not())
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = "Notice of I18n Support"
|
title = "Notice of I18n Support"
|
||||||
msg = "This Xposed Module is only for Chinese and the Chinese region.\n\n" +
|
msg = "This Xposed Module is only for Chinese and the Chinese region.\n\n" +
|
||||||
|
@@ -67,12 +67,15 @@ object IconRuleManagerTool {
|
|||||||
/** 当前规则的通知图标颜色 */
|
/** 当前规则的通知图标颜色 */
|
||||||
private const val OS_COLOR = 0xFF4E8A5A.toInt()
|
private const val OS_COLOR = 0xFF4E8A5A.toInt()
|
||||||
|
|
||||||
/** 同步地址 - Github Raw (代理) */
|
/** 同步地址 - GitHub Raw (直连) */
|
||||||
private const val SYNC_PROXY_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main"
|
|
||||||
|
|
||||||
/** 同步地址 - Github Raw (直连) */
|
|
||||||
private const val SYNC_DIRECT_URL = "https://raw.githubusercontent.com/fankes/AndroidNotifyIconAdapt/main"
|
private const val SYNC_DIRECT_URL = "https://raw.githubusercontent.com/fankes/AndroidNotifyIconAdapt/main"
|
||||||
|
|
||||||
|
/** 同步地址 - GitHub Raw (代理 - GitHub Proxy) */
|
||||||
|
private const val SYNC_PROXY_1_URL = "https://ghproxy.com/$SYNC_DIRECT_URL"
|
||||||
|
|
||||||
|
/** 同步地址 - GitHub Raw (代理 - 7ED Services) */
|
||||||
|
private const val SYNC_PROXY_2_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main"
|
||||||
|
|
||||||
/** 云端规则展示地址 (OS) */
|
/** 云端规则展示地址 (OS) */
|
||||||
private const val RULES_TRAVELER_OS_URL = "https://fankes.github.io/AndroidNotifyIconAdapt/?notify-rules-coloros"
|
private const val RULES_TRAVELER_OS_URL = "https://fankes.github.io/AndroidNotifyIconAdapt/?notify-rules-coloros"
|
||||||
|
|
||||||
@@ -104,13 +107,19 @@ object IconRuleManagerTool {
|
|||||||
}
|
}
|
||||||
binding.sourceFromTextLin.isVisible = sourceType == IconRuleSourceSyncType.CUSTOM_URL
|
binding.sourceFromTextLin.isVisible = sourceType == IconRuleSourceSyncType.CUSTOM_URL
|
||||||
binding.sourceTravelerLin.isVisible = sourceType != IconRuleSourceSyncType.CUSTOM_URL
|
binding.sourceTravelerLin.isVisible = sourceType != IconRuleSourceSyncType.CUSTOM_URL
|
||||||
binding.sourceRadio1.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY
|
binding.sourceRadio0.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY_1
|
||||||
|
binding.sourceRadio1.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY_2
|
||||||
binding.sourceRadio2.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_DIRECT
|
binding.sourceRadio2.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_DIRECT
|
||||||
binding.sourceRadio3.isChecked = sourceType == IconRuleSourceSyncType.CUSTOM_URL
|
binding.sourceRadio3.isChecked = sourceType == IconRuleSourceSyncType.CUSTOM_URL
|
||||||
|
binding.sourceRadio0.setOnClickListener {
|
||||||
|
binding.sourceFromTextLin.isVisible = false
|
||||||
|
binding.sourceTravelerLin.isVisible = true
|
||||||
|
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY_1
|
||||||
|
}
|
||||||
binding.sourceRadio1.setOnClickListener {
|
binding.sourceRadio1.setOnClickListener {
|
||||||
binding.sourceFromTextLin.isVisible = false
|
binding.sourceFromTextLin.isVisible = false
|
||||||
binding.sourceTravelerLin.isVisible = true
|
binding.sourceTravelerLin.isVisible = true
|
||||||
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY
|
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY_2
|
||||||
}
|
}
|
||||||
binding.sourceRadio2.setOnClickListener {
|
binding.sourceRadio2.setOnClickListener {
|
||||||
binding.sourceFromTextLin.isVisible = false
|
binding.sourceFromTextLin.isVisible = false
|
||||||
@@ -189,7 +198,8 @@ object IconRuleManagerTool {
|
|||||||
callback: () -> Unit
|
callback: () -> Unit
|
||||||
) {
|
) {
|
||||||
when (sourceType) {
|
when (sourceType) {
|
||||||
IconRuleSourceSyncType.GITHUB_RAW_PROXY -> onRefreshing(context, SYNC_PROXY_URL, callback)
|
IconRuleSourceSyncType.GITHUB_RAW_PROXY_1 -> onRefreshing(context, SYNC_PROXY_1_URL, callback)
|
||||||
|
IconRuleSourceSyncType.GITHUB_RAW_PROXY_2 -> onRefreshing(context, SYNC_PROXY_2_URL, callback)
|
||||||
IconRuleSourceSyncType.GITHUB_RAW_DIRECT -> onRefreshing(context, SYNC_DIRECT_URL, callback)
|
IconRuleSourceSyncType.GITHUB_RAW_DIRECT -> onRefreshing(context, SYNC_DIRECT_URL, callback)
|
||||||
IconRuleSourceSyncType.CUSTOM_URL ->
|
IconRuleSourceSyncType.CUSTOM_URL ->
|
||||||
if (customUrl.isNotBlank())
|
if (customUrl.isNotBlank())
|
||||||
|
@@ -27,7 +27,7 @@ import com.fankes.coloros.notify.BuildConfig
|
|||||||
import com.fankes.coloros.notify.utils.factory.openBrowser
|
import com.fankes.coloros.notify.utils.factory.openBrowser
|
||||||
import com.fankes.coloros.notify.utils.factory.showDialog
|
import com.fankes.coloros.notify.utils.factory.showDialog
|
||||||
import com.highcapable.yukihookapi.YukiHookAPI
|
import com.highcapable.yukihookapi.YukiHookAPI
|
||||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
import com.highcapable.yukihookapi.hook.factory.prefs
|
||||||
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
import com.highcapable.yukihookapi.hook.xposed.prefs.data.PrefsData
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,8 +43,8 @@ object YukiPromoteTool {
|
|||||||
* @param context 实例
|
* @param context 实例
|
||||||
*/
|
*/
|
||||||
fun promote(context: Context) {
|
fun promote(context: Context) {
|
||||||
fun saveReaded() = context.modulePrefs.put(YUKI_PROMOTE_READED, value = true)
|
fun saveReaded() = context.prefs().edit { put(YUKI_PROMOTE_READED, value = true) }
|
||||||
if (context.modulePrefs.get(YUKI_PROMOTE_READED).not())
|
if (context.prefs().get(YUKI_PROMOTE_READED).not())
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = "面向开发者的推广"
|
title = "面向开发者的推广"
|
||||||
msg = "你想快速拥有一个自己的 Xposed 模块吗,你只需要拥有基础的 Android 开发经验以及使用 Kotlin 编程语言即可。\n\n" +
|
msg = "你想快速拥有一个自己的 Xposed 模块吗,你只需要拥有基础的 Android 开发经验以及使用 Kotlin 编程语言即可。\n\n" +
|
||||||
|
10
app/src/main/res/drawable/ic_message.xml
Normal file
10
app/src/main/res/drawable/ic_message.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="48dp"
|
||||||
|
android:height="48dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ffffff"
|
||||||
|
android:pathData="m522.8,93.9c-244.2,0 -442.1,173.2 -442.1,386.9 0,122.1 64.9,230.9 165.8,301.7v195.7l193.7,-117.5c26.8,4.4 54.3,7 82.6,7 244.2,0 442.1,-173.2 442.1,-386.9C965,267.1 767.1,93.9 522.8,93.9Z"
|
||||||
|
android:strokeWidth="1.10883" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_notify_update.xml
Normal file
9
app/src/main/res/drawable/ic_notify_update.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="50dp"
|
||||||
|
android:height="50dp"
|
||||||
|
android:viewportWidth="1024"
|
||||||
|
android:viewportHeight="1024">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ffffff"
|
||||||
|
android:pathData="M906.4,791.6a247.9,247.9 0,0 0,-98.1 -186.5L808.3,399.4c0,-118.8 -85.1,-218.9 -197.4,-242.5v-4.7c0,-54.2 -44.5,-98.6 -98.8,-98.6 -54.3,0 -98.8,44.4 -98.8,98.6v4.7C300.8,180.5 215.7,280.4 215.7,399.4v205.8a247.7,247.7 0,0 0,-98.1 186.5h98.1v0.6h592.5v-0.6h98.1v-0.1zM491.1,970.4h24.5c64.3,0 117.8,-48.5 125.6,-110.7L383,859.8a126.8,126.8 0,0 0,125.6 110.7h-17.5z" />
|
||||||
|
</vector>
|
@@ -615,10 +615,41 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/notify_icon_force_system_color_item"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
||||||
|
android:id="@+id/notify_icon_force_system_color_switch"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:text="通知栏中的图标使用系统默认着色"
|
||||||
|
android:textColor="@color/colorTextGray"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<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="此选项默认关闭,开启后下拉通知栏中的通知图标将忽略图标自身的着色属性,全部使用系统默认颜色 (系统提供的统一色调) 着色,这是一个破坏原生通知图标的行为,仅针对部分有需要的用户而添加,我们不推荐开启这个功能,请根据个人偏好进行选择是否需要开启。"
|
||||||
|
android:textColor="@color/colorTextDark"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
||||||
android:id="@+id/notify_icon_force_app_icon_switch"
|
android:id="@+id/notify_icon_force_app_icon_switch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -633,7 +664,6 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:lineSpacingExtra="6dp"
|
android:lineSpacingExtra="6dp"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
@@ -646,8 +676,8 @@
|
|||||||
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
||||||
android:id="@+id/notify_media_panel_auto_exp_switch"
|
android:id="@+id/notify_media_panel_auto_exp_switch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="30dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
android:text="启用媒体通知播放时自动展开"
|
android:text="启用媒体通知播放时自动展开"
|
||||||
@@ -668,95 +698,70 @@
|
|||||||
android:textColor="@color/colorTextDark"
|
android:textColor="@color/colorTextDark"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
|
||||||
android:id="@+id/notify_panel_config_switch"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:paddingLeft="15dp"
|
|
||||||
android:paddingRight="15dp"
|
|
||||||
android:text="自定义通知面板背景透明度"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/colorTextGray"
|
|
||||||
android:textSize="15sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatSeekBar
|
|
||||||
android:id="@+id/notify_panel_config_seekbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:max="100"
|
|
||||||
android:min="0"
|
|
||||||
android:progress="75" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/notify_panel_config_text_panel"
|
android:id="@+id/notify_panel_config_item"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingTop="5dp"
|
|
||||||
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="75%"
|
|
||||||
android:textColor="@color/colorTextGray"
|
|
||||||
android:textSize="15sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<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="开启自定义功能后,你可以拖拽滑动条来调整通知面板的透明度,0% 为全透明,100% 为不透明。"
|
|
||||||
android:textColor="@color/colorTextDark"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/notify_panel_config_warn_panel"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<com.fankes.coloros.notify.ui.widget.MaterialSwitch
|
||||||
|
android:id="@+id/notify_panel_config_switch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="30dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:alpha="0.6"
|
|
||||||
android:lineSpacingExtra="6dp"
|
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
android:text="此功能为实验性功能,后期不一定继续维护,且仅在 ColorOS 12.1、13 测试通过,不能保证可以在任何系统版本中生效,以及和各种通知栏主题模块配合使用,如有冲突请关闭此功能或禁用相关重复功能的主题模块。"
|
android:text="自定义通知面板背景透明度"
|
||||||
android:textColor="@color/colorTextDark"
|
android:textAllCaps="false"
|
||||||
android:textSize="12sp"
|
android:textColor="@color/colorTextGray"
|
||||||
android:textStyle="bold" />
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatSeekBar
|
||||||
|
android:id="@+id/notify_panel_config_seekbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:max="100"
|
||||||
|
android:min="0"
|
||||||
|
android:progress="75" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/notify_panel_config_text_panel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
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="75%"
|
||||||
|
android:textColor="@color/colorTextGray"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -766,10 +771,42 @@
|
|||||||
android:lineSpacingExtra="6dp"
|
android:lineSpacingExtra="6dp"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingRight="15dp"
|
android:paddingRight="15dp"
|
||||||
android:text="已知问题:\n(1) 悬浮通知也会被透明,在透明度较低的时候下拉会有阴影光晕,松手释放后恢复正常,后期看需求再解决。\n(2) 被折叠的通知自动消除 (但并没有完全消除) 后,可能存在通知条目背景全透明的问题,此问题属于系统 BUG,目前暂无有效的解决办法来判断子布局是否已从叠加的通知条目中被移出。\n(3) 媒体通知可能在低于 ColorOS 12.1 的系统上无法生效透明度,旧版本不再适配,该问题不会被修复。"
|
android:text="开启自定义功能后,你可以拖拽滑动条来调整通知面板的透明度,0% 为全透明,100% 为不透明。"
|
||||||
android:textColor="@color/colorTextDark"
|
android:textColor="@color/colorTextDark"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp" />
|
||||||
android:textStyle="bold" />
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/notify_panel_config_warn_panel"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<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、13 测试通过,不能保证可以在任何系统版本中生效,以及和各种通知栏主题模块配合使用,如有冲突请关闭此功能或禁用相关重复功能的主题模块。"
|
||||||
|
android:textColor="@color/colorTextDark"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<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="已知问题:\n(1) 悬浮通知也会被透明,在透明度较低的时候下拉会有阴影光晕,松手释放后恢复正常,后期看需求再解决。\n(2) 被折叠的通知自动消除 (但并没有完全消除) 后,可能存在通知条目背景全透明的问题,此问题属于系统 BUG,目前暂无有效的解决办法来判断子布局是否已从叠加的通知条目中被移出。\n(3) 媒体通知可能在低于 ColorOS 12.1 的系统上无法生效透明度,旧版本不再适配,该问题不会被修复。"
|
||||||
|
android:textColor="@color/colorTextDark"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -1156,7 +1193,7 @@
|
|||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:alpha="0.8"
|
android:alpha="0.8"
|
||||||
android:lineSpacingExtra="10dp"
|
android:lineSpacingExtra="10dp"
|
||||||
android:text="Q.哪些是已知问题?\nA.以下是问题描述列表:\n(1) 由于机型有限,仅对 ColorOS 12、12.1、13 测试正常运行,根据酷友的需要云调试修复 ColorOS 11 的问题,其它版本情况未知,请自行进行测试。\n(2) OxygenOS 只支持 12、12.1、13 版本,其它类 ColorOS 魔改的 UI 理论没有问题,请自行测试。\n(3) 动态刷新系统界面为实验性功能,若动态地改变了系统深色模式,调节了分辨率和字体大小,状态栏、通知栏中的通知图标会还原或直接不起作用,或在刷新时发生图标黑白块问题,发生类似这种情况请手动重启一次系统界面即可解决。"
|
android:text="Q.哪些是已知问题?\nA.以下是问题描述列表:\n(1) 由于机型有限,仅对 ColorOS 12、12.1、13 测试正常运行,根据酷友的需要云调试修复 ColorOS 11 的问题,其它版本情况未知,请自行进行测试。\n(2) OxygenOS 只支持 12、12.1、13 版本,其它类 ColorOS 魔改的 UI 理论没有问题,请自行测试。\n(3) 动态刷新系统界面为实验性功能,若动态地改变了系统深色模式,调节了分辨率和字体大小,状态栏、通知栏中的通知图标会还原或直接不起作用,或在刷新时发生图标黑白块问题,发生类似这种情况请手动重启一次系统界面即可解决。\n(4) 部分机型的 ColorOS 12、12.1 版本概率性出现通知栏的通知图标黑白块问题,属于系统强制重新设置图标问题,无法修复,建议可以更新到 ColorOS 13 的机型更新系统解决,不再负责修复这个问题。"
|
||||||
android:textColor="@color/colorTextDark"
|
android:textColor="@color/colorTextDark"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
@@ -24,18 +24,25 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||||
|
android:id="@+id/source_radio_0"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="GitHub Raw (GitHub Proxy)"
|
||||||
|
app:buttonTint="@color/colorPrimaryAccent" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||||
android:id="@+id/source_radio_1"
|
android:id="@+id/source_radio_1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Github Raw (7ED Services)"
|
android:text="GitHub Raw (7ED Services)"
|
||||||
app:buttonTint="@color/colorPrimaryAccent" />
|
app:buttonTint="@color/colorPrimaryAccent" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||||
android:id="@+id/source_radio_2"
|
android:id="@+id/source_radio_2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Github Raw (直连)"
|
android:text="GitHub Raw (直连)"
|
||||||
app:buttonTint="@color/colorPrimaryAccent" />
|
app:buttonTint="@color/colorPrimaryAccent" />
|
||||||
|
|
||||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_launcher_background"/>
|
<background android:drawable="@color/ic_launcher_background" />
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
19
build.gradle
19
build.gradle
@@ -1,13 +1,24 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application' version '7.4.1' apply false
|
id 'com.android.application' version '7.4.1' apply false
|
||||||
id 'com.android.library' version '7.4.1' apply false
|
id 'com.android.library' version '7.4.1' apply false
|
||||||
id 'org.jetbrains.kotlin.android' version '1.7.22' apply false
|
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
|
||||||
|
id 'com.google.devtools.ksp' version '1.8.20-1.0.10' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
appVersionName = "1.9"
|
android = [
|
||||||
appVersionCode = 18
|
compileSdk: 33,
|
||||||
enableR8 = true
|
minSdk : 29,
|
||||||
|
targetSdk : 33
|
||||||
|
]
|
||||||
|
app = [
|
||||||
|
versionName : '1.97',
|
||||||
|
versionCode : 20,
|
||||||
|
signingConfigs: [
|
||||||
|
secretConfigsDirPath : "${projectDir.getAbsolutePath()}/.secret",
|
||||||
|
secretConfigsFileName: "key_store_secret.json"
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Wed May 25 04:24:55 CST 2022
|
#Wed May 25 04:24:55 CST 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
Reference in New Issue
Block a user