9 Commits
1.7 ... 1.75

Author SHA1 Message Date
384e6b657e Update version to 1.75 2022-05-05 15:17:04 +08:00
08b7feeede 优化通知面板背景透明度功能设置界面,添加实验性文案说明 2022-05-05 15:11:23 +08:00
e7fc0bbcd0 默认关闭通知面板背景透明度功能 2022-05-05 15:10:58 +08:00
1f8022fd7c 修复通知面板折叠通知背景异常问题,优化二级通知的背景 2022-05-05 15:10:46 +08:00
Fankesyooni
b404543f47 Merge pull request #16 from NextAlone/master
fix: notification summary background
2022-05-05 12:34:40 +08:00
NextAlone
ad195d93ea fix: notification summary background 2022-05-05 05:19:49 +08:00
15e7490808 Update YukiHookAPI 2022-05-04 14:03:55 +08:00
7c906cd2a0 Update YukiHookAPI 2022-05-04 10:15:55 +08:00
0da5875d64 Update YukiHookAPI 2022-05-04 09:32:30 +08:00
8 changed files with 84 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
[![Blank](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/fankes/ColorOSNotifyIcon)
[![Blank](https://img.shields.io/badge/license-AGPL3.0-blue)](https://github.com/fankes/ColorOSNotifyIcon/blob/master/LICENSE)
[![Blank](https://img.shields.io/badge/version-v1.7-green)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/badge/version-v1.75-green)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/fankes/ColorOSNotifyIcon/total?label=Release)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.fankes.coloros.notify/total?label=LSPosed%20Repo&logo=Android&style=flat&labelColor=F48FB1&logoColor=ffffff)](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
[![Telegram](https://img.shields.io/badge/Follow-Telegram-blue.svg?logo=telegram)](https://t.me/XiaofangInternet)

View File

@@ -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.85'
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.85'
implementation "com.github.topjohnwu.libsu:core:3.1.2"
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.0'

View File

@@ -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}_202205051512"
/** 当前模块的版本校验标签 */
const val MODULE_VERSION_VERIFY_TAG = "module_version_verify"

View File

@@ -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")

View File

@@ -534,12 +534,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
}
}
/** 缓存图标数据 */
@@ -704,7 +712,7 @@ class SystemUIHooker : YukiBaseHooker() {
name = "drawRegionBlur"
paramCount = 2
}
beforeHook { modifyNotifyPanelAlpha(args().last().cast<Drawable>()) }
beforeHook { modifyNotifyPanelAlpha(instance(), args().last().cast<Drawable>()) }
}
injectMember {
method {
@@ -712,7 +720,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 +730,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 {

View File

@@ -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) {

View File

@@ -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~12.1 测试正常,不能保证可以和各种通知栏主题模块配合使用,如有冲突请关闭此功能或禁用相关重复功能的主题模块。"
android:textColor="@color/colorTextDark"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout

View File

@@ -5,8 +5,8 @@ plugins {
}
ext {
appVersionName = "1.7"
appVersionCode = 12
appVersionName = "1.75"
appVersionCode = 13
enableR8 = true
}