mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
自定义时钟极客模式支持更多内容
This commit is contained in:
@@ -245,7 +245,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
//预设模式结束
|
//预设模式结束
|
||||||
|
|
||||||
//极客模式起始
|
//极客模式起始
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.custom_clock_format_geek)
|
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)
|
||||||
@@ -287,7 +287,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
|
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
TitleText(textId = R.string.status_bar_icon)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.hide_icon,
|
textId = R.string.hide_icon,
|
||||||
onClickListener = { showFragment("hide_icon") })
|
onClickListener = { showFragment("hide_icon") })
|
||||||
@@ -314,7 +314,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.custom_mobile_type_text)
|
setTitle(R.string.custom_mobile_type_text)
|
||||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
||||||
@@ -358,7 +358,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
SwitchV("big_mobile_type_icon_bold", true),
|
SwitchV("big_mobile_type_icon_bold", true),
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.big_mobile_type_icon_size,
|
textId = R.string.big_mobile_type_icon_size,
|
||||||
onClickListener = {
|
onClickListener = {
|
||||||
@@ -385,7 +385,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
}.show()
|
}.show()
|
||||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
||||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
setMessage("${activity.getString(R.string.range)} -15~15")
|
||||||
@@ -418,7 +418,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
}
|
}
|
||||||
}.show()
|
}.show()
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
||||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
setMessage("${activity.getString(R.string.range)} 0~30")
|
||||||
@@ -455,7 +455,7 @@ class SystemUIPageForS : BasePage() {
|
|||||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
||||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
Text(textId = R.string.maximum_number_of_notification_dots)
|
||||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.battery_percentage_font_size,
|
textId = R.string.battery_percentage_font_size,
|
||||||
onClickListener = {
|
onClickListener = {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.lt2333.simplicitytools.activity.pages.t
|
package com.lt2333.simplicitytools.activity.pages.t
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Switch
|
import android.widget.Switch
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
@@ -11,17 +13,16 @@ import cn.fkj233.ui.activity.view.SwitchV
|
|||||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||||
import cn.fkj233.ui.activity.view.TextV
|
import cn.fkj233.ui.activity.view.TextV
|
||||||
import cn.fkj233.ui.dialog.MIUIDialog
|
import cn.fkj233.ui.dialog.MIUIDialog
|
||||||
|
import cn.fkj233.ui.dialog.NewDialog
|
||||||
import com.lt2333.simplicitytools.R
|
import com.lt2333.simplicitytools.R
|
||||||
|
|
||||||
|
|
||||||
@BMPage("scope_systemui", "System UI", hideMenu = false)
|
@BMPage("scope_systemui", "System UI", hideMenu = false) class SystemUIPageForT : BasePage() {
|
||||||
class SystemUIPageForT : BasePage() {
|
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
TitleText(textId = R.string.statusbar)
|
TitleText(textId = R.string.statusbar)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(textId = R.string.double_tap_to_sleep),
|
TextSummaryV(textId = R.string.double_tap_to_sleep), SwitchV("status_bar_double_tap_to_sleep")
|
||||||
SwitchV("status_bar_double_tap_to_sleep")
|
|
||||||
)
|
)
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.status_bar_layout)
|
TitleText(textId = R.string.status_bar_layout)
|
||||||
@@ -31,12 +32,9 @@ class SystemUIPageForT : BasePage() {
|
|||||||
it[2] = getString(R.string.clock_right)
|
it[2] = getString(R.string.clock_right)
|
||||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
it[3] = getString(R.string.clock_center_and_icon_left)
|
||||||
}
|
}
|
||||||
TextWithSpinner(
|
TextWithSpinner(TextV(textId = R.string.status_bar_layout_mode), SpinnerV(
|
||||||
TextV(textId = R.string.status_bar_layout_mode),
|
|
||||||
SpinnerV(
|
|
||||||
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
||||||
"status_bar_layout_mode",
|
"status_bar_layout_mode", 0
|
||||||
0
|
|
||||||
)].toString()
|
)].toString()
|
||||||
) {
|
) {
|
||||||
add(statusBarLayoutMode[0].toString()) {
|
add(statusBarLayoutMode[0].toString()) {
|
||||||
@@ -55,8 +53,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
|
|
||||||
val layoutCompatibilityModeBinding = GetDataBinding({
|
val layoutCompatibilityModeBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getInt(
|
MIUIActivity.safeSP.getInt(
|
||||||
"screen_hole_location",
|
"screen_hole_location", 0
|
||||||
0
|
|
||||||
) == 2
|
) == 2
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -70,15 +67,11 @@ class SystemUIPageForT : BasePage() {
|
|||||||
it[1] = getString(R.string.center)
|
it[1] = getString(R.string.center)
|
||||||
it[2] = getString(R.string.left_or_right)
|
it[2] = getString(R.string.left_or_right)
|
||||||
}
|
}
|
||||||
TextSummaryWithSpinner(
|
TextSummaryWithSpinner(TextSummaryV(
|
||||||
TextSummaryV(
|
textId = R.string.layout_compatibility_mode, tipsId = R.string.screen_hole_location
|
||||||
textId = R.string.layout_compatibility_mode,
|
), SpinnerV(
|
||||||
tipsId = R.string.screen_hole_location
|
|
||||||
),
|
|
||||||
SpinnerV(
|
|
||||||
screenHoleLocation[MIUIActivity.safeSP.getInt(
|
screenHoleLocation[MIUIActivity.safeSP.getInt(
|
||||||
"screen_hole_location",
|
"screen_hole_location", 0
|
||||||
0
|
|
||||||
)].toString()
|
)].toString()
|
||||||
) {
|
) {
|
||||||
add(screenHoleLocation[0].toString()) {
|
add(screenHoleLocation[0].toString()) {
|
||||||
@@ -96,26 +89,16 @@ class SystemUIPageForT : BasePage() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.left_margin,
|
textId = R.string.left_margin, dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"status_bar_left_margin",
|
"status_bar_left_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||||
0,
|
|
||||||
300,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.right_margin,
|
textId = R.string.right_margin, dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"status_bar_right_margin",
|
"status_bar_right_margin", 0, 300, 0, dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||||
0,
|
|
||||||
300,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.status_bar_clock_format)
|
TitleText(textId = R.string.status_bar_clock_format)
|
||||||
@@ -123,8 +106,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
|
|
||||||
val customClockPresetBinding = GetDataBinding({
|
val customClockPresetBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getInt(
|
MIUIActivity.safeSP.getInt(
|
||||||
"custom_clock_mode",
|
"custom_clock_mode", 0
|
||||||
0
|
|
||||||
) == 1
|
) == 1
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -133,8 +115,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val customClockGeekBinding =
|
val customClockGeekBinding = GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
||||||
GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
|
||||||
|
|
||||||
) { view, flags, data ->
|
) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -148,12 +129,9 @@ class SystemUIPageForT : BasePage() {
|
|||||||
it[1] = getString(R.string.preset)
|
it[1] = getString(R.string.preset)
|
||||||
it[2] = getString(R.string.geek)
|
it[2] = getString(R.string.geek)
|
||||||
}
|
}
|
||||||
TextWithSpinner(
|
TextWithSpinner(TextV(textId = R.string.custom_clock_mode), SpinnerV(
|
||||||
TextV(textId = R.string.custom_clock_mode),
|
|
||||||
SpinnerV(
|
|
||||||
customClockMode[MIUIActivity.safeSP.getInt(
|
customClockMode[MIUIActivity.safeSP.getInt(
|
||||||
"custom_clock_mode",
|
"custom_clock_mode", 0
|
||||||
0
|
|
||||||
)].toString()
|
)].toString()
|
||||||
) {
|
) {
|
||||||
add(customClockMode[0].toString()) {
|
add(customClockMode[0].toString()) {
|
||||||
@@ -225,52 +203,53 @@ class SystemUIPageForT : BasePage() {
|
|||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.status_bar_clock_size,
|
textId = R.string.status_bar_clock_size, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"status_bar_clock_size",
|
"status_bar_clock_size", 0, 18, 0, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||||
0,
|
|
||||||
18,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.status_bar_clock_double_line_size,
|
textId = R.string.status_bar_clock_double_line_size,
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"status_bar_clock_double_line_size",
|
"status_bar_clock_double_line_size", 0, 9, 0, dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||||
0,
|
|
||||||
9,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
//预设模式结束
|
//预设模式结束
|
||||||
|
|
||||||
//极客模式起始
|
//极客模式起始
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
||||||
MIUIDialog(activity) {
|
NewDialog(activity) {
|
||||||
setTitle(R.string.custom_clock_format_geek)
|
setTitle(R.string.custom_clock_format_geek)
|
||||||
setEditText(
|
setEditText(
|
||||||
MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"),
|
MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false
|
||||||
"",
|
|
||||||
isSingleLine = false
|
|
||||||
)
|
)
|
||||||
setLButton(textId = R.string.cancel) {
|
Button(getString(R.string.click_to_view_use_cases)) {
|
||||||
dismiss()
|
val locale = context.resources.configuration.locale
|
||||||
|
val language = locale.language
|
||||||
|
if (language.endsWith("zh")) {
|
||||||
|
val uri = Uri.parse("https://zhuti.designer.xiaomi.com/docs/grammar/#%E6%97%B6%E9%97%B4%E6%97%A5%E6%9C%9F")
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||||
|
activity.startActivity(intent)
|
||||||
|
} else {
|
||||||
|
val uri = Uri.parse("https://docs.google.com/spreadsheets/d/1ghkT2iFbxB3bT4TKCiKAfmEdGt6kTVKFU3dm4Nz1or8/edit?usp=sharing")
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||||
|
activity.startActivity(intent)
|
||||||
}
|
}
|
||||||
setRButton(textId = R.string.Done) {
|
}
|
||||||
|
Button(getString(R.string.Done)) {
|
||||||
if (getEditText().isNotEmpty()) {
|
if (getEditText().isNotEmpty()) {
|
||||||
try {
|
try {
|
||||||
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
||||||
dismiss()
|
dismiss()
|
||||||
return@setRButton
|
return@Button
|
||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
||||||
.show()
|
}
|
||||||
|
Button(getString(R.string.cancel), cancelStyle = true) {
|
||||||
|
dismiss()
|
||||||
}
|
}
|
||||||
}.show()
|
}.show()
|
||||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
||||||
@@ -280,34 +259,25 @@ class SystemUIPageForT : BasePage() {
|
|||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.status_bar_clock_size,
|
textId = R.string.status_bar_clock_size, dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"status_bar_clock_size_geek",
|
"status_bar_clock_size_geek", 0, 18, 0, dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||||
0,
|
|
||||||
18,
|
|
||||||
0,
|
|
||||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
//极客模式结束
|
//极客模式结束
|
||||||
|
|
||||||
|
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.status_bar_icon)
|
TitleText(textId = R.string.status_bar_icon)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(textId = R.string.hide_icon, onClickListener = { showFragment("hide_icon") })
|
||||||
textId = R.string.hide_icon,
|
|
||||||
onClickListener = { showFragment("hide_icon") })
|
|
||||||
)
|
)
|
||||||
TextWithSwitch(
|
TextWithSwitch(
|
||||||
TextV(textId = R.string.show_wifi_standard),
|
TextV(textId = R.string.show_wifi_standard), SwitchV("show_wifi_standard")
|
||||||
SwitchV("show_wifi_standard")
|
|
||||||
)
|
)
|
||||||
val customMobileTypeTextBinding = GetDataBinding({
|
val customMobileTypeTextBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"custom_mobile_type_text_switch",
|
"custom_mobile_type_text_switch", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -316,13 +286,11 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(textId = R.string.custom_mobile_type_text_switch),
|
TextSummaryV(textId = R.string.custom_mobile_type_text_switch), SwitchV(
|
||||||
SwitchV(
|
"custom_mobile_type_text_switch", dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||||
"custom_mobile_type_text_switch",
|
|
||||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.custom_mobile_type_text)
|
setTitle(R.string.custom_mobile_type_text)
|
||||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
||||||
@@ -338,15 +306,13 @@ class SystemUIPageForT : BasePage() {
|
|||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
||||||
.show()
|
|
||||||
}
|
}
|
||||||
}.show()
|
}.show()
|
||||||
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
||||||
val bigMobileTypeIconBinding = GetDataBinding({
|
val bigMobileTypeIconBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"big_mobile_type_icon",
|
"big_mobile_type_icon", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -355,10 +321,8 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_icon),
|
TextSummaryV(textId = R.string.big_mobile_type_icon), SwitchV(
|
||||||
SwitchV(
|
"big_mobile_type_icon", dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
||||||
"big_mobile_type_icon",
|
|
||||||
dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val bigMobileTypeLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
val bigMobileTypeLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||||
@@ -366,11 +330,9 @@ class SystemUIPageForT : BasePage() {
|
|||||||
it[1] = getString(R.string.right)
|
it[1] = getString(R.string.right)
|
||||||
}
|
}
|
||||||
TextWithSpinner(
|
TextWithSpinner(
|
||||||
TextV(textId = R.string.big_mobile_type_location),
|
TextV(textId = R.string.big_mobile_type_location), SpinnerV(
|
||||||
SpinnerV(
|
|
||||||
bigMobileTypeLocation[MIUIActivity.safeSP.getInt(
|
bigMobileTypeLocation[MIUIActivity.safeSP.getInt(
|
||||||
"big_mobile_type_location",
|
"big_mobile_type_location", 1
|
||||||
1
|
|
||||||
)].toString()
|
)].toString()
|
||||||
) {
|
) {
|
||||||
add(bigMobileTypeLocation[0].toString()) {
|
add(bigMobileTypeLocation[0].toString()) {
|
||||||
@@ -379,8 +341,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
add(bigMobileTypeLocation[1].toString()) {
|
add(bigMobileTypeLocation[1].toString()) {
|
||||||
MIUIActivity.safeSP.putAny("big_mobile_type_location", 1)
|
MIUIActivity.safeSP.putAny("big_mobile_type_location", 1)
|
||||||
}
|
}
|
||||||
},
|
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(textId = R.string.big_mobile_type_only_show_network_card),
|
TextSummaryV(textId = R.string.big_mobile_type_only_show_network_card),
|
||||||
@@ -392,15 +353,12 @@ class SystemUIPageForT : BasePage() {
|
|||||||
SwitchV("big_mobile_type_icon_bold", true),
|
SwitchV("big_mobile_type_icon_bold", true),
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(textId = R.string.big_mobile_type_icon_size, onClickListener = {
|
||||||
textId = R.string.big_mobile_type_icon_size,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.big_mobile_type_icon_size)
|
setTitle(R.string.big_mobile_type_icon_size)
|
||||||
setEditText(
|
setEditText(
|
||||||
"",
|
"", "${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
||||||
"${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
||||||
}"
|
}"
|
||||||
)
|
)
|
||||||
@@ -410,8 +368,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
setRButton(textId = R.string.Done) {
|
setRButton(textId = R.string.Done) {
|
||||||
if (getEditText() != "") {
|
if (getEditText() != "") {
|
||||||
MIUIActivity.safeSP.putAny(
|
MIUIActivity.safeSP.putAny(
|
||||||
"big_mobile_type_icon_size",
|
"big_mobile_type_icon_size", getEditText().toFloat()
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -419,13 +376,12 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}.show()
|
}.show()
|
||||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
||||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
setMessage("${activity.getString(R.string.range)} -15~15")
|
||||||
setEditText(
|
setEditText(
|
||||||
"",
|
"", "${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
||||||
}"
|
}"
|
||||||
)
|
)
|
||||||
@@ -438,8 +394,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
val value = getEditText().toInt()
|
val value = getEditText().toInt()
|
||||||
if (value in (-15..15)) {
|
if (value in (-15..15)) {
|
||||||
MIUIActivity.safeSP.putAny(
|
MIUIActivity.safeSP.putAny(
|
||||||
"big_mobile_type_icon_up_and_down_position",
|
"big_mobile_type_icon_up_and_down_position", value
|
||||||
value
|
|
||||||
)
|
)
|
||||||
dismiss()
|
dismiss()
|
||||||
return@setRButton
|
return@setRButton
|
||||||
@@ -447,18 +402,16 @@ class SystemUIPageForT : BasePage() {
|
|||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
||||||
.show()
|
|
||||||
}
|
}
|
||||||
}.show()
|
}.show()
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
TextSummaryWithArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
||||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
setMessage("${activity.getString(R.string.range)} 0~30")
|
||||||
setEditText(
|
setEditText(
|
||||||
"",
|
"", "${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
|
||||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
||||||
}"
|
}"
|
||||||
)
|
)
|
||||||
@@ -471,8 +424,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
val value = getEditText().toInt()
|
val value = getEditText().toInt()
|
||||||
if (value in (0..30)) {
|
if (value in (0..30)) {
|
||||||
MIUIActivity.safeSP.putAny(
|
MIUIActivity.safeSP.putAny(
|
||||||
"big_mobile_type_icon_left_and_right_margins",
|
"big_mobile_type_icon_left_and_right_margins", value
|
||||||
value
|
|
||||||
)
|
)
|
||||||
dismiss()
|
dismiss()
|
||||||
return@setRButton
|
return@setRButton
|
||||||
@@ -480,8 +432,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT).show()
|
||||||
.show()
|
|
||||||
}
|
}
|
||||||
}.show()
|
}.show()
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||||
@@ -489,10 +440,8 @@ class SystemUIPageForT : BasePage() {
|
|||||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
||||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
Text(textId = R.string.maximum_number_of_notification_dots)
|
||||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
||||||
TextSummaryArrow(
|
TextSummaryWithArrow(
|
||||||
TextSummaryV(
|
TextSummaryV(textId = R.string.battery_percentage_font_size, onClickListener = {
|
||||||
textId = R.string.battery_percentage_font_size,
|
|
||||||
onClickListener = {
|
|
||||||
MIUIDialog(activity) {
|
MIUIDialog(activity) {
|
||||||
setTitle(R.string.battery_percentage_font_size)
|
setTitle(R.string.battery_percentage_font_size)
|
||||||
setMessage(R.string.zero_do_no_change)
|
setMessage(R.string.zero_do_no_change)
|
||||||
@@ -507,8 +456,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
setRButton(textId = R.string.Done) {
|
setRButton(textId = R.string.Done) {
|
||||||
if (getEditText() != "") {
|
if (getEditText() != "") {
|
||||||
MIUIActivity.safeSP.putAny(
|
MIUIActivity.safeSP.putAny(
|
||||||
"battery_percentage_font_size",
|
"battery_percentage_font_size", getEditText().toFloat()
|
||||||
getEditText().toFloat()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -518,8 +466,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.hide_battery_percentage_icon,
|
textId = R.string.hide_battery_percentage_icon, tipsId = R.string.hide_battery_percentage_icon_summary
|
||||||
tipsId = R.string.hide_battery_percentage_icon_summary
|
|
||||||
), SwitchV("hide_battery_percentage_icon")
|
), SwitchV("hide_battery_percentage_icon")
|
||||||
)
|
)
|
||||||
Line()
|
Line()
|
||||||
@@ -537,13 +484,11 @@ class SystemUIPageForT : BasePage() {
|
|||||||
), SwitchV("hide_status_bar_network_speed_second")
|
), SwitchV("hide_status_bar_network_speed_second")
|
||||||
)
|
)
|
||||||
TextWithSwitch(
|
TextWithSwitch(
|
||||||
TextV(textId = R.string.hide_network_speed_splitter),
|
TextV(textId = R.string.hide_network_speed_splitter), SwitchV("hide_network_speed_splitter")
|
||||||
SwitchV("hide_network_speed_splitter")
|
|
||||||
)
|
)
|
||||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"status_bar_dual_row_network_speed",
|
"status_bar_dual_row_network_speed", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -555,21 +500,17 @@ class SystemUIPageForT : BasePage() {
|
|||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.status_bar_dual_row_network_speed,
|
textId = R.string.status_bar_dual_row_network_speed,
|
||||||
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
||||||
),
|
), SwitchV(
|
||||||
SwitchV(
|
"status_bar_dual_row_network_speed", dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
||||||
"status_bar_dual_row_network_speed",
|
|
||||||
dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val align: HashMap<Int, String> = hashMapOf()
|
val align: HashMap<Int, String> = hashMapOf()
|
||||||
align[0] = getString(R.string.left)
|
align[0] = getString(R.string.left)
|
||||||
align[1] = getString(R.string.right)
|
align[1] = getString(R.string.right)
|
||||||
TextWithSpinner(
|
TextWithSpinner(
|
||||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity),
|
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity), SpinnerV(
|
||||||
SpinnerV(
|
|
||||||
align[MIUIActivity.safeSP.getInt(
|
align[MIUIActivity.safeSP.getInt(
|
||||||
"status_bar_network_speed_dual_row_gravity",
|
"status_bar_network_speed_dual_row_gravity", 0
|
||||||
0
|
|
||||||
)].toString()
|
)].toString()
|
||||||
) {
|
) {
|
||||||
add(align[0].toString()) {
|
add(align[0].toString()) {
|
||||||
@@ -579,21 +520,16 @@ class SystemUIPageForT : BasePage() {
|
|||||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
}, dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
TextWithSpinner(
|
TextWithSpinner(TextV(textId = R.string.status_bar_network_speed_dual_row_icon), SpinnerV(
|
||||||
TextV(textId = R.string.status_bar_network_speed_dual_row_icon),
|
|
||||||
SpinnerV(
|
|
||||||
MIUIActivity.safeSP.getString(
|
MIUIActivity.safeSP.getString(
|
||||||
"status_bar_network_speed_dual_row_icon",
|
"status_bar_network_speed_dual_row_icon", getString(R.string.none)
|
||||||
getString(R.string.none)
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
add(getString(R.string.none)) {
|
add(getString(R.string.none)) {
|
||||||
MIUIActivity.safeSP.putAny(
|
MIUIActivity.safeSP.putAny(
|
||||||
"status_bar_network_speed_dual_row_icon",
|
"status_bar_network_speed_dual_row_icon", getString(R.string.none)
|
||||||
getString(R.string.none)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
add("▲▼") {
|
add("▲▼") {
|
||||||
@@ -621,8 +557,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
TitleText(textId = R.string.notification_center)
|
TitleText(textId = R.string.notification_center)
|
||||||
val showWeatherMainSwitchBinding = GetDataBinding({
|
val showWeatherMainSwitchBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"notification_weather",
|
"notification_weather", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -632,20 +567,15 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}
|
}
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.show_weather_main_switch,
|
textId = R.string.show_weather_main_switch, colorId = R.color.blue
|
||||||
colorId = R.color.blue
|
), SwitchV(
|
||||||
),
|
"notification_weather", dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
||||||
SwitchV(
|
|
||||||
"notification_weather",
|
|
||||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.show_city,
|
textId = R.string.show_city,
|
||||||
),
|
), SwitchV("notification_weather_city"), dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
||||||
SwitchV("notification_weather_city"),
|
|
||||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
@@ -658,8 +588,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
TitleText(textId = R.string.control_center)
|
TitleText(textId = R.string.control_center)
|
||||||
val controlCenterWeatherBinding = GetDataBinding({
|
val controlCenterWeatherBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"control_center_weather",
|
"control_center_weather", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -672,18 +601,14 @@ class SystemUIPageForT : BasePage() {
|
|||||||
textId = R.string.show_weather_main_switch,
|
textId = R.string.show_weather_main_switch,
|
||||||
colorId = R.color.blue,
|
colorId = R.color.blue,
|
||||||
tipsId = R.string.control_center_weather_summary
|
tipsId = R.string.control_center_weather_summary
|
||||||
),
|
), SwitchV(
|
||||||
SwitchV(
|
"control_center_weather", dataBindingSend = controlCenterWeatherBinding.bindingSend
|
||||||
"control_center_weather",
|
|
||||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.show_city,
|
textId = R.string.show_city,
|
||||||
),
|
), SwitchV("control_center_weather_city"), dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
||||||
SwitchV("control_center_weather_city"),
|
|
||||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.lock_screen)
|
TitleText(textId = R.string.lock_screen)
|
||||||
@@ -706,8 +631,7 @@ class SystemUIPageForT : BasePage() {
|
|||||||
), SwitchV("remove_lock_screen_camera")
|
), SwitchV("remove_lock_screen_camera")
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(textId = R.string.enable_wave_charge_animation),
|
TextSummaryV(textId = R.string.enable_wave_charge_animation), SwitchV("enable_wave_charge_animation")
|
||||||
SwitchV("enable_wave_charge_animation")
|
|
||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
@@ -717,16 +641,14 @@ class SystemUIPageForT : BasePage() {
|
|||||||
)
|
)
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.double_tap_to_sleep,
|
textId = R.string.double_tap_to_sleep, tipsId = R.string.home_double_tap_to_sleep_summary
|
||||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
|
||||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
), SwitchV("lock_screen_double_tap_to_sleep")
|
||||||
)
|
)
|
||||||
Line()
|
Line()
|
||||||
TitleText(textId = R.string.old_quick_settings_panel)
|
TitleText(textId = R.string.old_quick_settings_panel)
|
||||||
val oldQSCustomSwitchBinding = GetDataBinding({
|
val oldQSCustomSwitchBinding = GetDataBinding({
|
||||||
MIUIActivity.safeSP.getBoolean(
|
MIUIActivity.safeSP.getBoolean(
|
||||||
"old_qs_custom_switch",
|
"old_qs_custom_switch", false
|
||||||
false
|
|
||||||
)
|
)
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
@@ -736,57 +658,35 @@ class SystemUIPageForT : BasePage() {
|
|||||||
}
|
}
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.old_qs_custom_switch,
|
textId = R.string.old_qs_custom_switch, colorId = R.color.blue
|
||||||
colorId = R.color.blue
|
), SwitchV(
|
||||||
),
|
"old_qs_custom_switch", dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
||||||
SwitchV(
|
|
||||||
"old_qs_custom_switch",
|
|
||||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.qs_custom_rows,
|
textId = R.string.qs_custom_rows, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"qs_custom_rows",
|
"qs_custom_rows", 1, 6, 3, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
1,
|
|
||||||
6,
|
|
||||||
3,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.qs_custom_rows_horizontal,
|
textId = R.string.qs_custom_rows_horizontal, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"qs_custom_rows_horizontal",
|
"qs_custom_rows_horizontal", 1, 3, 2, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
1,
|
|
||||||
3,
|
|
||||||
2,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.qs_custom_columns,
|
textId = R.string.qs_custom_columns, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"qs_custom_columns",
|
"qs_custom_columns", 1, 7, 4, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
1,
|
|
||||||
7,
|
|
||||||
4,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
textId = R.string.qs_custom_columns_unexpanded,
|
textId = R.string.qs_custom_columns_unexpanded,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
SeekBarWithText(
|
SeekBarWithText(
|
||||||
"qs_custom_columns_unexpanded",
|
"qs_custom_columns_unexpanded", 1, 7, 5, dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||||
1,
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ package com.lt2333.simplicitytools.hooks.rules.t.systemui
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Resources
|
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.github.kyuubiran.ezxhelper.utils.*
|
import com.github.kyuubiran.ezxhelper.utils.*
|
||||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||||
@@ -16,6 +14,7 @@ import java.lang.reflect.Method
|
|||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
object StatusBarTimeCustomizationForT : HookRegister() {
|
object StatusBarTimeCustomizationForT : HookRegister() {
|
||||||
|
|
||||||
private val getMode = XSPUtils.getInt("custom_clock_mode", 0)
|
private val getMode = XSPUtils.getInt("custom_clock_mode", 0)
|
||||||
@@ -30,14 +29,12 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false)
|
private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false)
|
||||||
private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false)
|
private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false)
|
||||||
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
||||||
private val isCenterAlign =
|
private val isCenterAlign = XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
|
||||||
XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
|
|
||||||
|
|
||||||
//极客模式
|
//极客模式
|
||||||
private val getGeekClockSize = XSPUtils.getInt("status_bar_clock_size_geek", 0)
|
private val getGeekClockSize = XSPUtils.getInt("status_bar_clock_size_geek", 0)
|
||||||
private val getGeekFormat = XSPUtils.getString("custom_clock_format_geek", "HH:mm:ss")
|
private val getGeekFormat = XSPUtils.getString("custom_clock_format_geek", "HH:mm:ss")
|
||||||
private val isGeekCenterAlign =
|
private val isGeekCenterAlign = XSPUtils.getBoolean("status_bar_time_center_align_geek", false)
|
||||||
XSPUtils.getBoolean("status_bar_time_center_align_geek", false)
|
|
||||||
|
|
||||||
private lateinit var nowTime: Date
|
private lateinit var nowTime: Date
|
||||||
private var str = ""
|
private var str = ""
|
||||||
@@ -83,9 +80,7 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Timer().scheduleAtFixedRate(
|
Timer().scheduleAtFixedRate(
|
||||||
T(),
|
T(), 1000 - System.currentTimeMillis() % 1000, 1000
|
||||||
1000 - System.currentTimeMillis() % 1000,
|
|
||||||
1000
|
|
||||||
)
|
)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
}
|
}
|
||||||
@@ -98,8 +93,7 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
val textV = it.thisObject as TextView
|
val textV = it.thisObject as TextView
|
||||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||||
val t = Settings.System.getString(
|
val t = Settings.System.getString(
|
||||||
c!!.contentResolver,
|
c!!.contentResolver, Settings.System.TIME_12_24
|
||||||
Settings.System.TIME_12_24
|
|
||||||
)
|
)
|
||||||
val is24 = t == "24"
|
val is24 = t == "24"
|
||||||
nowTime = Calendar.getInstance().time
|
nowTime = Calendar.getInstance().time
|
||||||
@@ -149,9 +143,7 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Timer().scheduleAtFixedRate(
|
Timer().scheduleAtFixedRate(
|
||||||
T(),
|
T(), 1000 - System.currentTimeMillis() % 1000, 1000
|
||||||
1000 - System.currentTimeMillis() % 1000,
|
|
||||||
1000
|
|
||||||
)
|
)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
}
|
}
|
||||||
@@ -159,12 +151,20 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
|
|
||||||
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
||||||
name == "updateTime"
|
name == "updateTime"
|
||||||
}.hookAfter {
|
}.hookBefore {
|
||||||
try {
|
try {
|
||||||
val textV = it.thisObject as TextView
|
val textV = it.thisObject as TextView
|
||||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||||
nowTime = Calendar.getInstance().time
|
val mMiuiStatusBarClockController = textV.getObject("mMiuiStatusBarClockController")
|
||||||
textV.text = SimpleDateFormat(getGeekFormat).format(nowTime)
|
val mCalendar = mMiuiStatusBarClockController.invokeMethodAuto("getCalendar")
|
||||||
|
mCalendar?.invokeMethodAuto(
|
||||||
|
"setTimeInMillis", System.currentTimeMillis()
|
||||||
|
)
|
||||||
|
val textSb = StringBuilder()
|
||||||
|
val formatSb = StringBuilder(getGeekFormat.toString())
|
||||||
|
mCalendar?.invokeMethodAuto("format", c, textSb, formatSb)
|
||||||
|
textV.text = textSb.toString()
|
||||||
|
it.result = null
|
||||||
}
|
}
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,5 +237,6 @@
|
|||||||
<string name="pkg_installer_summary">禁用频繁安装应用检查</string>
|
<string name="pkg_installer_summary">禁用频繁安装应用检查</string>
|
||||||
<string name="big_mobile_type_only_show_network_card">大移动类型图标仅显示上网卡</string>
|
<string name="big_mobile_type_only_show_network_card">大移动类型图标仅显示上网卡</string>
|
||||||
<string name="big_mobile_type_location">大移动类型图标位置</string>
|
<string name="big_mobile_type_location">大移动类型图标位置</string>
|
||||||
|
<string name="click_to_view_use_cases">点击查看用例</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -241,4 +241,5 @@
|
|||||||
<string name="pkg_installer_summary">Disable the app installation\'s count checking</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_only_show_network_card">Big mobile type only show network card</string>
|
||||||
<string name="big_mobile_type_location">Big mobile type location</string>
|
<string name="big_mobile_type_location">Big mobile type location</string>
|
||||||
|
<string name="click_to_view_use_cases">Click to view use cases</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user