新增A13大移动类型图标显示位置

This commit is contained in:
LittleTurtle2333
2023-02-15 22:01:30 +08:00
parent d8cf1bdc34
commit 7914d51168
4 changed files with 50 additions and 8 deletions

View File

@@ -12,10 +12,9 @@ import cn.fkj233.ui.activity.view.TextSummaryV
import cn.fkj233.ui.activity.view.TextV
import cn.fkj233.ui.dialog.MIUIDialog
import com.lt2333.simplicitytools.R
import java.util.HashMap
@BMPage("scope_systemui","System UI", hideMenu = false)
@BMPage("scope_systemui", "System UI", hideMenu = false)
class SystemUIPageForT : BasePage() {
override fun onCreate() {
@@ -151,7 +150,12 @@ class SystemUIPageForT : BasePage() {
}
TextWithSpinner(
TextV(textId = R.string.custom_clock_mode),
SpinnerV(customClockMode[MIUIActivity.safeSP.getInt("custom_clock_mode", 0)].toString()) {
SpinnerV(
customClockMode[MIUIActivity.safeSP.getInt(
"custom_clock_mode",
0
)].toString()
) {
add(customClockMode[0].toString()) {
MIUIActivity.safeSP.putAny("custom_clock_mode", 0)
customClockPresetBinding.binding.Send().send(false)
@@ -248,7 +252,11 @@ class SystemUIPageForT : BasePage() {
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
MIUIDialog(activity) {
setTitle(R.string.custom_clock_format_geek)
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false)
setEditText(
MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"),
"",
isSingleLine = false
)
setLButton(textId = R.string.cancel) {
dismiss()
}
@@ -353,6 +361,32 @@ class SystemUIPageForT : BasePage() {
dataBindingSend = bigMobileTypeIconBinding.bindingSend
)
)
val bigMobileTypeLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
it[0] = getString(R.string.left)
it[1] = getString(R.string.right)
}
TextWithSpinner(
TextV(textId = R.string.big_mobile_type_location),
SpinnerV(
bigMobileTypeLocation[MIUIActivity.safeSP.getInt(
"big_mobile_type_location",
1
)].toString()
) {
add(bigMobileTypeLocation[0].toString()) {
MIUIActivity.safeSP.putAny("big_mobile_type_location", 0)
}
add(bigMobileTypeLocation[1].toString()) {
MIUIActivity.safeSP.putAny("big_mobile_type_location", 1)
}
},
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.big_mobile_type_only_show_network_card),
SwitchV("big_mobile_type_only_show_network_card", false),
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
)
TextSummaryWithSwitch(
TextSummaryV(textId = R.string.big_mobile_type_icon_bold),
SwitchV("big_mobile_type_icon_bold", true),

View File

@@ -16,6 +16,7 @@ import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
object StatusBarBigMobileTypeIconForT : HookRegister() {
private val getLocation = XSPUtils.getInt("big_mobile_type_location", 1)
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
private val leftAndRightMargin = XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
private val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true)
@@ -56,10 +57,12 @@ object StatusBarBigMobileTypeIconForT : HookRegister() {
val mobileTypeSingle = statusBarMobileView.findViewById<TextView>(mobileTypeSingleId)
//更改顺序
if (getLocation == 1) {
mobileGroup.removeView(mobileTypeSingle)
mobileGroup.addView(mobileTypeSingle)
mobileGroup.removeView(mobileContainerLeft)
mobileGroup.addView(mobileContainerLeft)
}
//更改样式
mobileTypeSingle.textSize = size

View File

@@ -235,4 +235,7 @@
<string name="make_millet_ignore_active_summary">非常激进,可能会影响应用运行</string>
<string name="pkg_installer">应用包管理组件</string>
<string name="pkg_installer_summary">禁用频繁安装应用检查</string>
<string name="big_mobile_type_only_show_network_card">大移动类型图标仅显示上网卡</string>
<string name="big_mobile_type_location">大移动类型图标位置</string>
</resources>

View File

@@ -239,4 +239,6 @@
<string name="make_millet_ignore_active_summary">Very aggressive and may affect application running</string>
<string name="pkg_installer">Package Installer</string>
<string name="pkg_installer_summary">Disable the app installation\'s count checking</string>
<string name="big_mobile_type_only_show_network_card">Big mobile type only show network card</string>
<string name="big_mobile_type_location">Big mobile type location</string>
</resources>