From 398135859261392470b437151df63e20ec823900 Mon Sep 17 00:00:00 2001 From: ghhccghk <2137610394@qq.com> Date: Fri, 10 Jan 2025 20:59:05 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E6=AD=8C=E8=AF=8D=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9E=82=E7=9B=B4=E7=BF=BB=E8=BD=AC=E5=92=8C?= =?UTF-8?q?=E6=B0=B4=E5=B9=B3=E7=BF=BB=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyric/hook/module/SystemUILyric.kt | 2 +- .../statusbar/lyric/tools/LyricViewTools.kt | 26 ++++++++++++++++++- .../statusbar/lyric/ui/page/LyricPage.kt | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt b/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt index cb921d62..27fb9188 100644 --- a/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt +++ b/app/src/main/kotlin/statusbar/lyric/hook/module/SystemUILyric.kt @@ -951,7 +951,7 @@ class SystemUILyric : BaseHook() { } val animation = config.lyricAnimation - isRandomAnima = animation == 9 + isRandomAnima = animation == 11 if (!isRandomAnima) { val interpolator = config.lyricInterpolator val duration = config.animationDuration diff --git a/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt b/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt index 639e26a9..ed4b7eb4 100644 --- a/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt +++ b/app/src/main/kotlin/statusbar/lyric/tools/LyricViewTools.kt @@ -19,7 +19,7 @@ import android.widget.ImageView import statusbar.lyric.view.LyricSwitchView object LyricViewTools { - private var animaList: ArrayList = arrayListOf(1, 2, 3, 4, 5, 6, 7, 8) + private var animaList: ArrayList = arrayListOf(1, 2, 3, 4, 5, 6, 7, 8, 9 ,10) val randomAnima: Int get() = animaList.random() fun getAlphaAnimation(into: Boolean, duration: Long = 250): AnimationSet { @@ -42,6 +42,18 @@ object LyricViewTools { 6 -> ScaleAnimation(0f, 1f, 0f, 1f) 7 -> ScaleAnimation(0f, 1f, 1f, 1f) 8 -> ScaleAnimation(1f, 1f, 0f, 1f) + 9 -> ScaleAnimation( + -1f, 1f, // X 方向从正常比例翻转到反向 + 1f, 1f, // Y 方向保持不变 + Animation.RELATIVE_TO_SELF, 0.5f, // X 轴中心点:视图的中间 + Animation.RELATIVE_TO_SELF, 0.5f // Y 轴中心点:视图的中间 + ) + 10 -> ScaleAnimation( + 1f, 1f, // X 方向保持不变 + -1f, 1f, // Y 方向从正常比例翻转到反向 + Animation.RELATIVE_TO_SELF, 0.5f, // X 轴中心点:视图的中间 + Animation.RELATIVE_TO_SELF, 0.5f // Y 轴中心点:视图的中间 + ) else -> return null }?.apply { duration = t @@ -64,6 +76,18 @@ object LyricViewTools { 6 -> ScaleAnimation(1f, 0f, 1f, 0f) 7 -> ScaleAnimation(1f, 0f, 1f, 1f) 8 -> ScaleAnimation(1f, 1f, 1f, 0f) + 9 -> ScaleAnimation( + 1f, -1f, // X 方向从正常比例翻转到反向 + 1f, 1f, // Y 方向保持不变 + Animation.RELATIVE_TO_SELF, 0.5f, // X 轴中心点:视图的中间 + Animation.RELATIVE_TO_SELF, 0.5f // Y 轴中心点:视图的中间 + ) + 10 -> ScaleAnimation( + 1f, 1f, // X 方向保持不变 + 1f, -1f, // Y 方向从正常比例翻转到反向 + Animation.RELATIVE_TO_SELF, 0.5f, // X 轴中心点:视图的中间 + Animation.RELATIVE_TO_SELF, 0.5f // Y 轴中心点:视图的中间 + ) else -> return null }?.apply { duration = t diff --git a/app/src/main/kotlin/statusbar/lyric/ui/page/LyricPage.kt b/app/src/main/kotlin/statusbar/lyric/ui/page/LyricPage.kt index f779b0e6..bd27985f 100644 --- a/app/src/main/kotlin/statusbar/lyric/ui/page/LyricPage.kt +++ b/app/src/main/kotlin/statusbar/lyric/ui/page/LyricPage.kt @@ -78,6 +78,8 @@ fun LyricPage(navController: NavController, currentStartDestination: MutableStat stringResource(R.string.lyrics_animation_scale_x_y), stringResource(R.string.lyrics_animation_scale_x), stringResource(R.string.lyrics_animation_scale_y), + stringResource(R.string.lyrics_animation_horizontalflip), + stringResource(R.string.lyrics_animation_verticalflip), stringResource(R.string.lyrics_animation_random), ) val lyricAnimSelectedOption = remember { mutableIntStateOf(config.lyricAnimation) } diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 65d7168c..ffdd381b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -154,4 +154,6 @@ 确定要重置配置吗? 歌词添加位置 自动处理焦点通知 + "水平翻转" + 垂直翻转 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 691b06bc..076a5e9c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -156,4 +156,6 @@ Are you sure you want to clear the configuration? Lyrics add location Automate focus notifications + Horizontal Flip + Vertical Flip \ No newline at end of file