diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/MusicBaseHook.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/base/MusicBaseHook.kt index 9886fa9e2..9f7891dc7 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/MusicBaseHook.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/MusicBaseHook.kt @@ -73,12 +73,17 @@ abstract class MusicBaseHook : BaseHook() { fun sendNotification(text: String) { // logE("sendNotification: " + context.packageName + ": " + text) createNotificationChannel() + val isClickClock = mPrefsMap.getBoolean("system_ui_statusbar_music_click_clock") val launchIntent = context.packageManager.getLaunchIntentForPackage(context.packageName) val bitmap = context.packageManager.getActivityIcon(launchIntent!!).toBitmap() val builder = NotificationCompat.Builder(context, CHANNEL_ID) val intent = Intent("$CHANNEL_ID.actions.switchClockStatus") - val pendingIntent = + // 需要重启音乐软件生效 + val pendingIntent = if (isClickClock) { PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE) + } else { + PendingIntent.getActivity(context, 0, launchIntent, PendingIntent.FLAG_MUTABLE) + } builder.setContentTitle(text) builder.setSmallIcon(IconCompat.createWithBitmap(bitmap)) builder.setTicker(text).setPriority(NotificationCompat.PRIORITY_LOW) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 6ed3015ab..6183eb3da 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -925,6 +925,8 @@ 显示设置 隐藏状态栏时钟 显示焦点歌词时隐藏状态栏时钟,并调整下拉通知中心的动画 + 点按显示时钟 + 单击焦点歌词事件变更为显示状态栏时钟,反之隐藏,开关需要重启音乐软件才能生效 歌词滚动速率 歌词滚动延迟 歌词末尾垫宽 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 15ef03294..be7b1bac4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -904,6 +904,8 @@ Display settings Hide status bar clock Hide the status bar clock when showing focused lyrics, and adjust the animation of the dropdown Notification shade. + Click to show clock + Click the focus lyrics event to change the status bar clock to display, otherwise hide it. The switch needs to restart the corresponding music software to take effect. Lyrics scroll rate Lyrics scroll delay Add whitespace at the end of lyrics diff --git a/app/src/main/res/xml/system_ui_status_bar_music.xml b/app/src/main/res/xml/system_ui_status_bar_music.xml index fe78c7ce8..700cffa74 100644 --- a/app/src/main/res/xml/system_ui_status_bar_music.xml +++ b/app/src/main/res/xml/system_ui_status_bar_music.xml @@ -40,6 +40,13 @@ android:summary="@string/system_ui_statusbar_music_hide_clock_desc" android:title="@string/system_ui_statusbar_music_hide_clock_title" /> + +