Skip to content

Commit

Permalink
优化提示
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowine committed Feb 18, 2024
1 parent ef4fc47 commit fa8b370
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/cn/lyric/getter/tool/AppRulesTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object AppRulesTools {

fun getAppStatusDescription(status: AppStatus, rule: Rule, useColor: Boolean = true): String {
return when (status) {
AppStatus.API -> addHtmlColor(R.string.api, "#388E3C", useColor)
AppStatus.API -> addHtmlColor(context.getString(R.string.api).format(rule.apiVersion), "#388E3C", useColor)
AppStatus.Hook -> addHtmlColor(context.getString(R.string.hook).format(rule.getLyricType.lyricType()), "#388E3C", useColor)
AppStatus.LowApi -> addHtmlColor(context.getString(R.string.low_api).format(rule.apiVersion, BuildConfig.API_VERSION), "#F57C00", useColor)
AppStatus.MoreAPI -> addHtmlColor(context.getString(R.string.more_api).format(rule.apiVersion, BuildConfig.API_VERSION), "#F57C00", useColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ class AppRulesAdapter : RecyclerView.Adapter<BaseViewHolder<*>>() {
}
} else {
val status1 = status.filter { it == AppStatus.API || it == AppStatus.Hook }
if (status1.size == 1) {
description = getAppStatusDescription(status1[0], rules[status.indexOf(status1[0])])
description = if (status1.size == 1) {
getAppStatusDescription(status1[0], rules[status.indexOf(status1[0])])
} else {
"<font color='#388E3C'>${context.getString(R.string.multiple_modes_work)}</font>"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<string name="show_hide_desktop_icons">显示/隐藏桌面图标</string>
<string name="getting_app_information">正在获取应用信息</string>
<string name="getting_app_information_tips">请稍后…</string>
<string name="api">API模式</string>
<string name="api">API模式%s</string>
<string name="more_api">过高的API版本\n目前版本%s,所需版本%s</string>
<string name="low_api">过低的API版本\n目前版本%s,所需版本%s</string>
<string name="hook">Hook模式:%s</string>
Expand Down Expand Up @@ -70,4 +70,5 @@
<string name="notice">通知</string>
<string name="salt_use_flyme">椒盐/糖醋音乐使用魅族状态栏歌词接口</string>
<string name="salt_use_flyme_summary">在API模式正常时,不建议切换</string>
<string name="multiple_modes_work">有多个可正常使用的模式</string>
</resources>

0 comments on commit fa8b370

Please sign in to comment.