更新设置菜单

This commit is contained in:
乌堆小透明
2022-02-25 21:48:14 +08:00
parent b4634b512e
commit 3001a17a57
2 changed files with 107 additions and 56 deletions

View File

@@ -58,7 +58,12 @@ class SettingsActivity : MIUIActivity() {
override fun mainItems(): ArrayList<BaseView> { override fun mainItems(): ArrayList<BaseView> {
return arrayListOf<BaseView>().apply { return arrayListOf<BaseView>().apply {
add(TextWithSwitchV(TextV(resId = R.string.main_switch), SwitchV("main_switch",true))) add(
TextWithSwitchV(
TextV(resId = R.string.main_switch, colorId = R.color.purple_700),
SwitchV("main_switch", true)
)
)
add( add(
TextWithSwitchV( TextWithSwitchV(
TextV(resId = R.string.HideLauncherIcon), TextV(resId = R.string.HideLauncherIcon),
@@ -75,6 +80,27 @@ class SettingsActivity : MIUIActivity() {
}) })
) )
) )
add(
TextSummaryArrowV(
TextSummaryV(
textId = R.string.matters_needing_attention,
colorId = R.color.red,
onClickListener = {
MIUIDialog(activity).apply {
setTitle(R.string.matters_needing_attention)
setMessage(
"""首次激活或更新后建议重启手机
|绝大部分功能更改后需要在右上角重启作用域后生效
""".trimMargin()
)
setRButton(R.string.Done) {
dismiss()
}
show()
}
})
)
)
add(TitleTextV(resId = R.string.ui)) add(TitleTextV(resId = R.string.ui))
add( add(
TextWithSwitchV( TextWithSwitchV(
@@ -110,10 +136,12 @@ class SettingsActivity : MIUIActivity() {
) )
add(LineV()) add(LineV())
add(TitleTextV(resId = R.string.status_bar_clock_format)) add(TitleTextV(resId = R.string.status_bar_clock_format))
add(TextWithSwitchV( add(
TextV(resId = R.string.custom_clock_switch), TextWithSwitchV(
TextV(resId = R.string.custom_clock_switch, colorId = R.color.purple_700),
SwitchV("custom_clock_switch") SwitchV("custom_clock_switch")
)) )
)
add( add(
TextWithSwitchV( TextWithSwitchV(
TextV(resId = R.string.status_bar_time_year), TextV(resId = R.string.status_bar_time_year),
@@ -147,7 +175,7 @@ class SettingsActivity : MIUIActivity() {
add( add(
TextWithSwitchV( TextWithSwitchV(
TextV(resId = R.string.status_bar_time_period), TextV(resId = R.string.status_bar_time_period),
SwitchV("status_bar_time_period",true) SwitchV("status_bar_time_period", true)
) )
) )
add( add(
@@ -168,6 +196,10 @@ class SettingsActivity : MIUIActivity() {
SwitchV("status_bar_time_double_line") SwitchV("status_bar_time_double_line")
) )
) )
add(TextV(resId = R.string.status_bar_clock_size))
add(SeekBarWithTextV("status_bar_clock_size", 0, 18, 0))
add(TextV(resId = R.string.status_bar_clock_double_line_size))
add(SeekBarWithTextV("status_bar_clock_double_line_size", 0, 8, 0))
add(LineV()) add(LineV())
add(TitleTextV(resId = R.string.status_bar_icon)) add(TitleTextV(resId = R.string.status_bar_icon))
add( add(
@@ -268,12 +300,20 @@ class SettingsActivity : MIUIActivity() {
add(TextWithSwitchV(TextV(resId = R.string.home_time), SwitchV("home_time"))) add(TextWithSwitchV(TextV(resId = R.string.home_time), SwitchV("home_time")))
add(LineV()) add(LineV())
add(TitleTextV(resId = R.string.performance)) add(TitleTextV(resId = R.string.performance))
add(TextWithSwitchV(TextV(resId = R.string.lock_max_fps), SwitchV("lock_max_fps"))) add(
TextSummaryWithSwitchV(
TextSummaryV(textId = R.string.lock_max_fps, tips = "支持添加下拉控制中心快速开关,实时切换"),
SwitchV("lock_max_fps")
)
)
add(LineV()) add(LineV())
add(TitleTextV(resId = R.string.other)) add(TitleTextV(resId = R.string.other))
add( add(
TextWithSwitchV( TextSummaryWithSwitchV(
TextV(resId = R.string.disable_flag_secure), TextSummaryV(
textId = R.string.disable_flag_secure,
tips = "支持添加下拉控制中心快速开关,保障安全"
),
SwitchV("disable_flag_secure") SwitchV("disable_flag_secure")
) )
) )
@@ -292,6 +332,7 @@ class SettingsActivity : MIUIActivity() {
add(LineV()) add(LineV())
add(TitleTextV(resId = R.string.about)) add(TitleTextV(resId = R.string.about))
add( add(
TextSummaryArrowV(
TextSummaryV( TextSummaryV(
textId = R.string.opensource, textId = R.string.opensource,
tipsId = R.string.github_url, tipsId = R.string.github_url,
@@ -306,7 +347,9 @@ class SettingsActivity : MIUIActivity() {
} }
}) })
) )
)
add( add(
TextSummaryArrowV(
TextSummaryV( TextSummaryV(
textId = R.string.issues, textId = R.string.issues,
tipsId = R.string.issues_url, tipsId = R.string.issues_url,
@@ -321,7 +364,9 @@ class SettingsActivity : MIUIActivity() {
} }
}) })
) )
)
add( add(
TextSummaryArrowV(
TextSummaryV( TextSummaryV(
textId = R.string.dev_coolapk, textId = R.string.dev_coolapk,
tipsId = R.string.dev_coolapk_name, tipsId = R.string.dev_coolapk_name,
@@ -333,7 +378,8 @@ class SettingsActivity : MIUIActivity() {
Uri.parse("coolmarket://u/883441") Uri.parse("coolmarket://u/883441")
) )
) )
Toast.makeText(activity, "乌堆小透明:靓仔,点个关注吧!", Toast.LENGTH_SHORT).show() Toast.makeText(activity, "乌堆小透明:靓仔,点个关注吧!", Toast.LENGTH_SHORT)
.show()
} catch (e: Exception) { } catch (e: Exception) {
Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show() Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show()
val uri = Uri.parse("http://www.coolapk.com/u/883441") val uri = Uri.parse("http://www.coolapk.com/u/883441")
@@ -342,12 +388,16 @@ class SettingsActivity : MIUIActivity() {
} }
}) })
) )
)
add( add(
TextSummaryArrowV(
TextSummaryV( TextSummaryV(
textId = R.string.verison, textId = R.string.verison,
tips = "${BuildConfig.VERSION_NAME}(${BuildConfig.BUILD_TYPE})" tips = "${BuildConfig.VERSION_NAME}(${BuildConfig.BUILD_TYPE})"
) )
) )
)
} }
} }

View File

@@ -7,4 +7,5 @@
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="red">#FF0000</color>
</resources> </resources>