From 573c30d76bb574898173d7cdbf3b58fb2db4c257 Mon Sep 17 00:00:00 2001 From: "xiaowine0@gmail.com" <143322369ye> Date: Thu, 7 Apr 2022 21:49:47 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index d0531474..718981aa 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -340,8 +340,7 @@ class SystemUI : BaseHook() { showLyric = false clock.setOnClickListener { // 歌词显示 lyricLayout.visibility = View.VISIBLE // 设置歌词文本 - // lyricSwitchView.setSourceText(lyricSwitchView.text) - // 隐藏时钟 + lyricSwitchView.setSourceText(lyricSwitchView.text) // 隐藏时钟 clock.layoutParams = LinearLayout.LayoutParams(0, 0) showLyric = true } From a39bd0a207f1c0429f52e06189726f8459d26f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Fri, 8 Apr 2022 13:02:58 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AD=8C=E8=AF=8D?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index 718981aa..d8dc2221 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -340,7 +340,7 @@ class SystemUI : BaseHook() { showLyric = false clock.setOnClickListener { // 歌词显示 lyricLayout.visibility = View.VISIBLE // 设置歌词文本 - lyricSwitchView.setSourceText(lyricSwitchView.text) // 隐藏时钟 + lyricSwitchView.setCurrentText(lyricSwitchView.text) // 隐藏时钟 clock.layoutParams = LinearLayout.LayoutParams(0, 0) showLyric = true } @@ -406,7 +406,7 @@ class SystemUI : BaseHook() { } } Utils.setStatusBar(application, false, config) - lyricSwitchView.setSourceText(lyric) + lyricSwitchView.setText(lyric) true } From a752e419f0860495a238a2a1777420043c0aa818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Fri, 8 Apr 2022 13:59:51 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=AD=8C=E8=AF=8D=E6=9A=82=E5=81=9C=E5=90=8E?= =?UTF-8?q?=E8=BF=98=E8=83=BD=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index d8dc2221..e72b86bf 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -417,7 +417,7 @@ class SystemUI : BaseHook() { clock.layoutParams = clockParams // show clock if (config.getLyricSwitch()) { // set clock click listener clock.isClickable = clockClickable - clock.getObjectField("mListenerInfo")?.setObjectField("mOnClickListener", clockOnClickListener) + clock.getObjectField("mListenerInfo")?.setObjectField("mOnClickListener", clockOnClickListener).isNull { clock.setOnClickListener(null) } } Utils.setStatusBar(application, true, config) // set miui statusbar true From cd821d632fc3712332d83934be5b4b9aa976a706 Mon Sep 17 00:00:00 2001 From: "xiaowine0@gmail.com" <143322369ye> Date: Fri, 8 Apr 2022 18:36:20 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 1cb89028..ff7d0bed 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -104,7 +104,7 @@ 图标大小 0~50 0%~100% - 测试 + 模块测试 此功能内嵌于 SystemUI,可能会导致 SystemUI 崩溃重启。 启动 返回 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7a4f3ecd..d7171f1e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -106,7 +106,7 @@ 圖標大小 0~50 0%~100% - 測試 + 模塊測試 這個功能是內嵌在SystemUI裏的,可能會導致SystemUI崩潰重啓! 啓動 返回 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 85a8b7a8..d46283c7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -115,7 +115,7 @@ Icon Size 0~50, current: 0%~100%, current: - Test + Module Test This function is embedded in the system UI and may cause the system UI to crash and restart! From fab73b98fba8f477561460a502129cd29b781533 Mon Sep 17 00:00:00 2001 From: "xiaowine0@gmail.com" <143322369ye> Date: Fri, 8 Apr 2022 20:55:04 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyric/activity/SettingsActivity.kt | 54 +++++++++++++------ .../java/statusbar/lyric/config/Config.kt | 22 ++++++-- .../java/statusbar/lyric/hook/app/SystemUI.kt | 44 ++++++++++++++- app/src/main/res/values-zh-rCN/strings.xml | 4 +- app/src/main/res/values-zh-rTW/strings.xml | 4 +- app/src/main/res/values/strings.xml | 4 +- 6 files changed, 108 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt b/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt index 509b8824..5db2007d 100644 --- a/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt +++ b/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt @@ -368,14 +368,14 @@ class SettingsActivity : MIUIActivity() { }.show() }) SeekBarWithText("LSpacing", 0, 200) - val dict: HashMap = hashMapOf() - dict["off"] = getString(R.string.Off) - dict["top"] = getString(R.string.top) - dict["lower"] = getString(R.string.lower) - dict["left"] = getString(R.string.left) - dict["right"] = getString(R.string.right) - dict["random"] = getString(R.string.random) - TextWithSpinner(TextV(resId = R.string.LyricsAnimation), SpinnerV(dict[ActivityOwnSP.ownSPConfig.getAnim()]!!) { + val aDicts: HashMap = hashMapOf() + aDicts["off"] = getString(R.string.Off) + aDicts["top"] = getString(R.string.top) + aDicts["lower"] = getString(R.string.lower) + aDicts["left"] = getString(R.string.left) + aDicts["right"] = getString(R.string.right) + aDicts["random"] = getString(R.string.random) + TextWithSpinner(TextV(resId = R.string.LyricsAnimation), SpinnerV(aDicts[ActivityOwnSP.ownSPConfig.getAnim()]!!) { add(getString(R.string.Off)) { ActivityOwnSP.ownSPConfig.setAnim("off") } add(getString(R.string.top)) { ActivityOwnSP.ownSPConfig.setAnim("top") } add(getString(R.string.lower)) { ActivityOwnSP.ownSPConfig.setAnim("lower") } @@ -420,6 +420,37 @@ class SettingsActivity : MIUIActivity() { }.show() }, dataBindingRecv = meiZuStyle.binding.getRecv(2)) SeekBarWithText("LSpeed", 0, 200, defaultProgress = 100, dataBindingRecv = meiZuStyle.binding.getRecv(2)) + val lDict: HashMap = hashMapOf() + lDict["first"] = getString(R.string.First) + lDict["latest"] = getString(R.string.Latest) + TextWithSpinner(TextV(resId = R.string.LyricViewPosition), SpinnerV(lDict[ActivityOwnSP.ownSPConfig.getLyricViewPosition()]!!) { + add(getString(R.string.First)) { ActivityOwnSP.ownSPConfig.setLyricViewPosition("first") } + add(getString(R.string.Latest)) { ActivityOwnSP.ownSPConfig.setLyricViewPosition("latest") } + }) + val cDict: HashMap = hashMapOf() + cDict["first"] = getString(R.string.First) + cDict["latest"] = getString(R.string.Latest) + TextWithSpinner(TextV(resId = R.string.CustomizePosition), SpinnerV(cDict[ActivityOwnSP.ownSPConfig.getCustomizeViewPosition()]!!) { + add(getString(R.string.First)) { ActivityOwnSP.ownSPConfig.setCustomizeViewPosition("first") } + add(getString(R.string.Latest)) { ActivityOwnSP.ownSPConfig.setCustomizeViewPosition("latest") } + }) + TextSummaryArrow(TextSummaryV(textId = R.string.CustomizeText, onClickListener = { + MIUIDialog(activity) { + setTitle(R.string.CustomizeText) + setEditText(ActivityOwnSP.ownSPConfig.getCustomizeText(),"") + setRButton(R.string.Ok) { + try { + val value = getEditText() + ActivityOwnSP.ownSPConfig.setCustomizeText(value) + } catch (_: Throwable) { + } + dismiss() + } + setLButton(R.string.Cancel) { + dismiss() + } + }.show() + })) TextSummaryArrow(TextSummaryV(textId = R.string.CustomFont, onClickListener = { MIUIDialog(activity) { setTitle(R.string.CustomFont) @@ -681,13 +712,6 @@ class SettingsActivity : MIUIActivity() { TextWithSwitch(TextV(resId = R.string.AutoHideNotiIcon), SwitchV("HNoticeIcon")) TextWithSwitch(TextV(resId = R.string.HideNetWork), SwitchV("HNetSpeed")) TextWithSwitch(TextV(resId = R.string.AutoHideCarrierName), SwitchV("HCuk")) - val dict: HashMap = hashMapOf() - dict["first"] = getString(R.string.First) - dict["latest"] = getString(R.string.Latest) - TextWithSpinner(TextV(resId = R.string.ViewPosition), SpinnerV(dict[ActivityOwnSP.ownSPConfig.getViewPosition()]!!) { - add(getString(R.string.First)) { ActivityOwnSP.ownSPConfig.setViewPosition("first") } - add(getString(R.string.Latest)) { ActivityOwnSP.ownSPConfig.setViewPosition("latest") } - }) Text(resId = R.string.DelayedLoading, onClickListener = { MIUIDialog(activity) { setTitle(R.string.DelayedLoading) diff --git a/app/src/main/java/statusbar/lyric/config/Config.kt b/app/src/main/java/statusbar/lyric/config/Config.kt index 07b2af7a..36b4169b 100644 --- a/app/src/main/java/statusbar/lyric/config/Config.kt +++ b/app/src/main/java/statusbar/lyric/config/Config.kt @@ -192,13 +192,27 @@ class Config { fun setAnim(str: String) { config.put("Anim", str) } + fun getCustomizeText(): String { + return config.optString("CustomizeText", "") + } + + fun setCustomizeText(str: String) { + config.put("CustomizeText", str) + } - fun getViewPosition(): String { - return config.optString("ViewPosition", "first") + fun getLyricViewPosition(): String { + return config.optString("LyricViewPosition", "first") + } + + fun setLyricViewPosition(str: String) { + config.put("LyricViewPosition", str) + } + fun getCustomizeViewPosition(): String { + return config.optString("CustomizeViewPositio", "first") } - fun setViewPosition(str: String) { - config.put("ViewPosition", str) + fun setCustomizeViewPosition(str: String) { + config.put("CustomizeViewPositio", str) } fun getHook(): String { diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index e72b86bf..b678a268 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -73,6 +73,7 @@ class SystemUI : BaseHook() { // base data lateinit var application: Application lateinit var clock: TextView + private lateinit var customizeView: TextView lateinit var lyricSwitchView: LyricSwitchView private lateinit var iconView: ImageView private lateinit var lyricLayout: LinearLayout @@ -286,6 +287,31 @@ class SystemUI : BaseHook() { clockParams = clock.layoutParams as LinearLayout.LayoutParams + customizeView = TextView(application).apply { + height = clock.height + visibility = View.VISIBLE + text = config.getCustomizeText() + setTextSize(TypedValue.COMPLEX_UNIT_SHIFT, if (config.getLyricSize() == 0) clock.textSize else config.getLyricSize().toFloat()) + isSingleLine = true + try { + val file = File(application.filesDir.path + "/font") + if (file.exists() && file.isFile && file.canRead()) { + typeface = Typeface.createFromFile(application.filesDir.path + "/font") + LogUtils.e(LogMultiLang.fontLoad) + } else { + typeface = clock.typeface + } + } catch (e: Throwable) { + typeface = clock.typeface + runCatching { + val file = File(application.filesDir.path + "/font") + if (file.exists() && file.canWrite()) { + file.delete() + } + } + LogUtils.e("${LogMultiLang.initFontFailed}(${e.message}): ${Log.getStackTraceString(e)}") + } + } lyricSwitchView = LyricSwitchView(application, config.getLyricStyle()).apply { width = (displayWidth * 35) / 100 height = clock.height @@ -325,7 +351,15 @@ class SystemUI : BaseHook() { lyricLayout = LinearLayout(application).apply { layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT).also { it.setMargins(config.getLyricPosition(), config.getLyricHigh(), 0, 0) } addView(iconView) - addView(lyricSwitchView) + if (config.getCustomizeViewPosition() == "first") { + addView(customizeView) + addView(lyricSwitchView) + } else { + addView(lyricSwitchView) + addView(customizeView) + } + + } clockClickable = clock.isClickable @@ -377,6 +411,7 @@ class SystemUI : BaseHook() { updateTextColor = Handler(Looper.getMainLooper()) { message -> lyricSwitchView.setTextColor(message.arg1) + customizeView.setTextColor(message.arg1) true } @@ -403,6 +438,10 @@ class SystemUI : BaseHook() { style = Paint.Style.FILL_AND_STROKE strokeWidth = (config.getLyricFontWeight().toFloat() / 100) } + customizeView.paint.apply { + style = Paint.Style.FILL_AND_STROKE + strokeWidth = (config.getLyricFontWeight().toFloat() / 100) + } } } Utils.setStatusBar(application, false, config) @@ -429,7 +468,7 @@ class SystemUI : BaseHook() { gravity = Gravity.CENTER orientation = LinearLayout.HORIZONTAL (lyricLayout.parent as? ViewGroup)?.removeView(lyricLayout) - if (config.getViewPosition() == "first") addView(lyricLayout, 1) else addView(lyricLayout) + if (config.getLyricViewPosition() == "first") addView(lyricLayout, 1) else addView(lyricLayout) } updateConfig() offLyric(LogMultiLang.initOk) @@ -637,6 +676,7 @@ class SystemUI : BaseHook() { val error = FileUtils(application).copyFile(File(path), application.filesDir.path, "font") if (error.isEmpty()) { lyricSwitchView.setTypeface(Typeface.createFromFile(application.filesDir.path + "/font")) + customizeView.typeface = Typeface.createFromFile(application.filesDir.path + "/font") LogUtils.e(LogMultiLang.fontLoad) application.sendBroadcast(Intent().apply { action = "App_Server" diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index ff7d0bed..f2ac0b9b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -118,7 +118,8 @@ Hook 系统界面失败\n此系统不支持模块工作,打包 SystemUI 发作者吧 控件首 控件尾 - * 控件添加位置 + * 歌词控件添加位置 + * 自定义文字控件添加位置 菜单 检查更新 备份配置 @@ -148,4 +149,5 @@ 反馈日志请不要截图\n在 LSPosed 右上角保存为文件反馈 带 * 的功能改动后需要重启系统界面 垂直滚动条上方的标题是可以点击手动输入范围的哟 + * 自定义文本 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d7171f1e..1869948a 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -120,7 +120,8 @@ Hook 系统界面失败\n此系统不支持,打包SystemUI发作者吧 控件首 控件尾 - * 控件添加位置 + * 歌词控件添加位置 + * 自定義文字控件添加位置 菜單 檢查更新 備份配置 @@ -149,4 +150,5 @@ 反饋日誌請不要截圖\nLsp右上角保存成文件反饋 帶 * 的功能改動需要重啟系統界面 垂直滾動條上方的標題是可以點擊手動輸入範圍的喲 + * 自定義文本 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d46283c7..e90feff6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -133,7 +133,8 @@ View Header View Latest - * View add position + * Lyrics view add position + * CustomizeText view add position Menu Check Update Backup Config @@ -167,5 +168,6 @@ The function changes with * need to restart the SystemUI The title above the vertical scroll bar can be clicked to manually enter the range + * Customize Text \ No newline at end of file From 3fb3fe425dbd3ad446ab6c0a12c12b4f44d88b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 9 Apr 2022 12:00:28 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=8A=A8=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lyric/activity/SettingsActivity.kt | 19 ++++++++++++++----- .../main/java/statusbar/lyric/utils/Utils.kt | 8 ++++++++ blockmiui | 2 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt b/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt index 5db2007d..34cce261 100644 --- a/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt +++ b/app/src/main/java/statusbar/lyric/activity/SettingsActivity.kt @@ -35,9 +35,9 @@ import android.os.Build import android.os.Bundle import android.os.Handler import android.os.Looper -import android.util.Log import android.view.View import android.widget.ImageView +import android.widget.LinearLayout import cn.fkj233.ui.activity.MIUIActivity import cn.fkj233.ui.activity.view.* import cn.fkj233.ui.dialog.MIUIDialog @@ -51,6 +51,7 @@ import statusbar.lyric.BuildConfig import statusbar.lyric.R import statusbar.lyric.config.IconConfig import statusbar.lyric.utils.* +import statusbar.lyric.utils.Utils.indexOfArr import java.util.* import kotlin.system.exitProcess @@ -554,7 +555,14 @@ class SettingsActivity : MIUIActivity() { register("icon", getString(R.string.IconSettings), true) { val iconConfig = Utils.getSP(activity, "Icon_Config")?.let { IconConfig(it) } - for (icon in arrayOf("Netease", "KuGou", "QQMusic", "Myplayer", "MiGu", "MiPlayer", "Default")) { + val iconList = arrayOf("Netease", "KuGou", "QQMusic", "Myplayer", "MiGu", "MiPlayer", "Default") + val iconDataBinding = GetDataBinding("") { view, i, any -> + if ((any as String).isNotEmpty()) { + val iconData = any.split("|%|") + if (iconList[i] == iconData[0]) ((view as LinearLayout).getChildAt(0) as RoundCornerImageView).background = BitmapDrawable(Utils.stringToBitmap(if (iconData[1] == "") iconConfig?.getIcon(iconData[0]) else iconData[1])).also { it.setTint(getColor(R.color.customIconColor)) } + } + } + for (icon in iconList) { Author(BitmapDrawable(Utils.stringToBitmap(iconConfig?.getIcon(icon))).also { it.setTint(getColor(R.color.customIconColor)) }, icon, round = 0f, onClick = { MIUIDialog(activity) { setTitle(icon) @@ -563,7 +571,8 @@ class SettingsActivity : MIUIActivity() { setRButton(R.string.Ok) { if (getEditText().isNotEmpty()) { try { - iconConfig?.setIcon(icon, getEditText()) + iconConfig?.setIcon(icon, getEditText().replace(" ", "").replace("\n", "")) + iconDataBinding.bindingSend.send("$icon|%|${getEditText().replace(" ", "").replace("\n", "")}") updateConfig = true dismiss() return@setRButton @@ -572,13 +581,14 @@ class SettingsActivity : MIUIActivity() { } ActivityUtils.showToastOnLooper(activity, getString(R.string.InputError)) iconConfig?.setIcon(icon, iconConfig.getDefaultIcon(icon)) + iconDataBinding.bindingSend.send("$icon|%|") ActivityUtils.showToastOnLooper(activity, getString(R.string.InputError)) updateConfig = true dismiss() } setLButton(R.string.Cancel) { dismiss() } }.show() - }) + }, dataBindingRecv = iconDataBinding.binding.getRecv(iconList.indexOfArr(icon))) } TextSummaryArrow(TextSummaryV(textId = R.string.MakeIcon, onClickListener = { val componentName = ComponentName("com.byyoung.setting", "com.byyoung.setting.MediaFile.activitys.ImageBase64Activity") @@ -836,7 +846,6 @@ class SettingsActivity : MIUIActivity() { } OPEN_FONT_FILE -> { data.data?.let { - Log.e("Lyric_Server", data.data?.toString().toString()) activity.sendBroadcast(Intent().apply { action = "Lyric_Server" putExtra("Lyric_Type", "copy_font") diff --git a/app/src/main/java/statusbar/lyric/utils/Utils.kt b/app/src/main/java/statusbar/lyric/utils/Utils.kt index fa926e64..1e1c0ee0 100644 --- a/app/src/main/java/statusbar/lyric/utils/Utils.kt +++ b/app/src/main/java/statusbar/lyric/utils/Utils.kt @@ -46,6 +46,7 @@ import java.io.IOException import java.io.PrintWriter import java.io.StringWriter import java.util.* +import kotlin.collections.ArrayList @SuppressLint("StaticFieldLeak") @@ -285,4 +286,11 @@ object Utils { } catch (ignored: Throwable) { } } + + fun Array.indexOfArr(value: E): Int { + for (index in 0..this.size) { + if (this[index] == value) return index + } + return -1 + } } diff --git a/blockmiui b/blockmiui index c64502c1..97f1fc1b 160000 --- a/blockmiui +++ b/blockmiui @@ -1 +1 @@ -Subproject commit c64502c13915bc98a73a408df68c5d10535d3776 +Subproject commit 97f1fc1bbb8d0a0957a2ba573fd43f401f91f72a From 7c0674357a6a08b5c5498904db242d1bb8217733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 9 Apr 2022 12:07:55 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index b678a268..a09220b0 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -514,7 +514,10 @@ class SystemUI : BaseHook() { width = config.getIconSize() height = config.getIconSize() } - } // lyricSwitchView.setStyle(config.getLyricStyle()) + } + if (config.getLyricSize() != 0) { + lyricSwitchView.setTextSize(TypedValue.COMPLEX_UNIT_SHIFT, config.getLyricSize().toFloat()) + } } private fun offLyric(info: String) { // off Lyric From 08736f2a9d062686d08d915e62f804ac09ebecf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 9 Apr 2022 12:20:40 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E4=BD=8D=E7=BD=AE=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt index a09220b0..02c3275a 100644 --- a/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt +++ b/app/src/main/java/statusbar/lyric/hook/app/SystemUI.kt @@ -316,7 +316,7 @@ class SystemUI : BaseHook() { width = (displayWidth * 35) / 100 height = clock.height setTextSize(TypedValue.COMPLEX_UNIT_SHIFT, if (config.getLyricSize() == 0) clock.textSize else config.getLyricSize().toFloat()) - setMargins(10, 0, 0, 0) + setMargins(config.getLyricPosition() + 10, config.getLyricHigh(), 0, 0) setMarqueeRepeatLimit(if (config.getLyricStyle()) 1 else -1) setSingleLine(true) setMaxLines(1) @@ -383,11 +383,11 @@ class SystemUI : BaseHook() { iconUpdate = Handler(Looper.getMainLooper()) { message -> if (message.obj == null) { - lyricSwitchView.setMargins(0, 0, 0, 0) + lyricSwitchView.setMargins(config.getLyricPosition(), config.getLyricHigh(), 0, 0) iconView.visibility = View.GONE iconView.setImageDrawable(null) } else { - lyricSwitchView.setMargins(10, 0, 0, 0) + lyricSwitchView.setMargins(config.getLyricPosition() + 10, config.getLyricHigh(), 0, 0) iconView.visibility = View.VISIBLE iconView.setImageDrawable(message.obj as Drawable) } From b2bbd79d381d3db58f2ecac85fe46a5fab89ec15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 9 Apr 2022 12:35:57 +0800 Subject: [PATCH 09/12] sign aab test --- .github/workflows/Android_Dev.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Android_Dev.yml b/.github/workflows/Android_Dev.yml index 7670148e..4fce2afc 100644 --- a/.github/workflows/Android_Dev.yml +++ b/.github/workflows/Android_Dev.yml @@ -64,6 +64,17 @@ jobs: keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} keyPassword: ${{ secrets.KEY_STORE_PASSWORD }} + - name: Sign Release AAB + if: success() + id: sign_release_aab + uses: r0adkll/sign-android-release@v1.0.4 + with: + releaseDirectory: ./app/build/outputs/bundle/release/ + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: xiao_wine + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_STORE_PASSWORD }} + - name: Upload Release APK uses: actions/upload-artifact@v2 with: @@ -74,7 +85,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: StatusBarLyric_aab - path: ./app/build/outputs/bundle/release/app-release.aab + path: ${{ steps.sign_release_aab.outputs.signedReleaseFile }} - name: Upload Debug APK uses: actions/upload-artifact@v2 From 527ec42ca4cdf9bbae76de23749d6b99b96bd9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Sat, 9 Apr 2022 13:29:44 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e90feff6..dfc507e0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -11,13 +11,13 @@ Lyrics animation * Lyric color * Icon color - Lyrcs icon + Lyrics icon Lyrics scroll speed Advanced settings * Click on the lyrics to switch the clock and lyrics * Anti-burn screen Icon up and down position - * Lyrics left and right position + * Left and right positions of lyrics Default Unlock display only @@ -25,7 +25,7 @@ Hide network speed Auto hide lock screen carrier name * Custom Hook (do not move if you don\'t understand) - Debug Mode + Debug mode Restart SystemUI Reset module About From 86b12b8de32fb62976d467292a2afcc04b8366c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= <86393520+577fkj@users.noreply.github.com> Date: Sat, 9 Apr 2022 13:35:49 +0800 Subject: [PATCH 11/12] New Crowdin updates (#179) * New translations strings.xml (Chinese Traditional) [ci skip] New translations from Crowdin * New translations strings.xml (Chinese Simplified) [ci skip] New translations from Crowdin * Update source file strings.xml [ci skip] New translations from Crowdin * Update source file strings.xml [ci skip] New translations from Crowdin * Update source file strings.xml [ci skip] New translations from Crowdin * New translations strings.xml (Chinese Simplified) [ci skip] New translations from Crowdin * Update source file strings.xml [ci skip] New translations from Crowdin * Update source file strings.xml [ci skip] New translations from Crowdin --- app/src/main/res/values-zh-rCN/strings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index f2ac0b9b..4f5725b5 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -144,8 +144,7 @@ 制作图标 无法跳转,请检查是否安装\n爱玩机工具箱 延迟加载 - 本模块使用了 Microsoft AppCenter 来统计或收集月活量、崩溃数据和用户信息等指标,一切内容与模块无关 - + 本模块使用 Microsoft AppCenter 统计或采集月活动、崩溃数据。收集的数据与本模块无关 反馈日志请不要截图\n在 LSPosed 右上角保存为文件反馈 带 * 的功能改动后需要重启系统界面 垂直滚动条上方的标题是可以点击手动输入范围的哟 From 2e4d2ceaf4cf96d99961728eda2ffce4d415d495 Mon Sep 17 00:00:00 2001 From: "xiaowine0@gmail.com" <143322369ye> Date: Sat, 9 Apr 2022 15:28:15 +0800 Subject: [PATCH 12/12] 5.2.5 --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index bf24713d..abb2fed9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,8 +12,8 @@ android { applicationId = "statusbar.lyric" minSdk = 26 targetSdk = 32 - versionCode = 147 - versionName = "5.0.0" + versionCode = 157 + versionName = "5.2.5" aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false }