mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-14 20:31:19 +08:00
修复A12状态栏布局兼容模式的一些BUG
This commit is contained in:
@@ -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 SystemUIPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
@@ -54,11 +53,10 @@ class SystemUIPageForS : BasePage() {
|
||||
}
|
||||
})
|
||||
|
||||
val layoutCompatibilityModeBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
) == 2
|
||||
val layoutCompatibilityBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"layout_compatibility_mode", false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
@@ -66,57 +64,23 @@ class SystemUIPageForS : BasePage() {
|
||||
}
|
||||
}
|
||||
|
||||
val screenHoleLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.center)
|
||||
it[2] = getString(R.string.left_or_right)
|
||||
}
|
||||
TextSummaryWithSpinner(
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.layout_compatibility_mode,
|
||||
tipsId = R.string.screen_hole_location
|
||||
),
|
||||
SpinnerV(
|
||||
screenHoleLocation[MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(screenHoleLocation[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 0)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 1)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 2)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(true)
|
||||
}
|
||||
})
|
||||
textId = R.string.layout_compatibility_mode, tipsId = R.string.layout_compatibility_mode_summary
|
||||
), SwitchV("layout_compatibility_mode", dataBindingSend = layoutCompatibilityBinding.bindingSend)
|
||||
)
|
||||
|
||||
Text(
|
||||
textId = R.string.left_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
textId = R.string.left_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_left_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
"status_bar_left_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.right_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
textId = R.string.right_margin, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_right_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
"status_bar_right_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_clock_format)
|
||||
@@ -248,7 +212,11 @@ class SystemUIPageForS : BasePage() {
|
||||
TextSummaryWithArrow(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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user