mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-15 21:01:18 +08:00
Compare commits
17 Commits
63cd327239
...
91c3b8311b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91c3b8311b | ||
|
|
a414e2a9c8 | ||
|
|
73325ee306 | ||
|
|
a9d43e9977 | ||
|
|
a0e0741924 | ||
|
|
a38d9c661c | ||
|
|
422189b16e | ||
|
|
12726a5831 | ||
|
|
999f9a088f | ||
|
|
49c293d30d | ||
|
|
87a8059a06 | ||
|
|
8e85c34db3 | ||
|
|
72ad0479df | ||
|
|
479251fb67 | ||
|
|
dec3bc0a42 | ||
|
|
32f2fc7215 | ||
|
|
4246e2910e |
@@ -6,12 +6,12 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 32
|
||||
buildToolsVersion = "32.0.0"
|
||||
compileSdk = 33
|
||||
buildToolsVersion = "33.0.0"
|
||||
defaultConfig {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
targetSdk = 33
|
||||
versionCode = 67
|
||||
versionName = "1.6.6"
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<activity
|
||||
android:name=".activity.SettingsActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -93,7 +93,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.scope)
|
||||
TitleText(textId = R.string.scope)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_systemui,
|
||||
@@ -116,7 +116,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.about)
|
||||
TitleText(textId = R.string.about)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.about_module,
|
||||
@@ -127,14 +127,14 @@ class SettingsActivity : MIUIActivity() {
|
||||
|
||||
}
|
||||
register("scope_systemui", getString(R.string.scope_systemui), false) {
|
||||
TitleText(resId = R.string.statusbar)
|
||||
TitleText(textId = R.string.statusbar)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.double_tap_to_sleep
|
||||
), SwitchV("status_bar_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.status_bar_layout)
|
||||
TitleText(textId = R.string.status_bar_layout)
|
||||
val statusBarLayoutMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.default1)
|
||||
it[1] = getString(R.string.clock_center)
|
||||
@@ -142,7 +142,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(resId = R.string.status_bar_layout_mode),
|
||||
TextV(textId = R.string.status_bar_layout_mode),
|
||||
SpinnerV(
|
||||
statusBarLayoutMode[safeSP.getInt(
|
||||
"status_bar_layout_mode",
|
||||
@@ -163,10 +163,11 @@ class SettingsActivity : MIUIActivity() {
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
val layoutCompatibilityModeBinding = GetDataBinding(
|
||||
object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getBoolean("layout_compatibility_mode", false)
|
||||
return safeSP.getInt("screen_hole_location", 0)==2
|
||||
}
|
||||
}
|
||||
) { view, flags, data ->
|
||||
@@ -175,18 +176,37 @@ class SettingsActivity : MIUIActivity() {
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.layout_compatibility_mode,
|
||||
tipsId = R.string.layout_compatibility_mode_summary
|
||||
),
|
||||
SwitchV(
|
||||
"layout_compatibility_mode",
|
||||
dataBindingSend = layoutCompatibilityModeBinding.bindingSend
|
||||
)
|
||||
|
||||
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(
|
||||
TextSummaryV(textId = R.string.layout_compatibility_mode, tipsId = R.string.screen_hole_location),
|
||||
SpinnerV(
|
||||
screenHoleLocation[safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(screenHoleLocation[0].toString()) {
|
||||
safeSP.putAny("screen_hole_location", 0)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[1].toString()) {
|
||||
safeSP.putAny("screen_hole_location", 1)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[2].toString()) {
|
||||
safeSP.putAny("screen_hole_location", 2)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(true)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Text(
|
||||
resId = R.string.left_margin,
|
||||
textId = R.string.left_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -197,7 +217,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.right_margin,
|
||||
textId = R.string.right_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -208,10 +228,12 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.status_bar_clock_format)
|
||||
val customClockBinding = GetDataBinding(object : DefValue {
|
||||
TitleText(textId = R.string.status_bar_clock_format)
|
||||
|
||||
|
||||
val customClockPresetBinding = GetDataBinding(object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getBoolean("custom_clock_switch", false)
|
||||
return safeSP.getInt("custom_clock_mode", 0)==1
|
||||
}
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
@@ -219,81 +241,170 @@ class SettingsActivity : MIUIActivity() {
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.custom_clock_switch, colorId = R.color.purple_700),
|
||||
SwitchV(
|
||||
"custom_clock_switch",
|
||||
dataBindingSend = customClockBinding.bindingSend
|
||||
)
|
||||
|
||||
val customClockGeekBinding = GetDataBinding(object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getInt("custom_clock_mode", 0)==2
|
||||
}
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val customClockMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.preset)
|
||||
it[2] = getString(R.string.geek)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.custom_clock_mode),
|
||||
SpinnerV(
|
||||
customClockMode[safeSP.getInt(
|
||||
"custom_clock_mode",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(customClockMode[0].toString()) {
|
||||
safeSP.putAny("custom_clock_mode", 0)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[1].toString()) {
|
||||
safeSP.putAny("custom_clock_mode", 1)
|
||||
customClockPresetBinding.binding.Send().send(true)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[2].toString()) {
|
||||
safeSP.putAny("custom_clock_mode", 2)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(true)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
//预设模式起始
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_year),
|
||||
TextV(textId = R.string.status_bar_time_year),
|
||||
SwitchV("status_bar_time_year"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_month),
|
||||
TextV(textId = R.string.status_bar_time_month),
|
||||
SwitchV("status_bar_time_month"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_day),
|
||||
TextV(textId = R.string.status_bar_time_day),
|
||||
SwitchV("status_bar_time_day"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_week),
|
||||
TextV(textId = R.string.status_bar_time_week),
|
||||
SwitchV("status_bar_time_week"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_double_hour),
|
||||
TextV(textId = R.string.status_bar_time_double_hour),
|
||||
SwitchV("status_bar_time_double_hour"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_period),
|
||||
TextV(textId = R.string.status_bar_time_period),
|
||||
SwitchV("status_bar_time_period", true),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_seconds),
|
||||
TextV(textId = R.string.status_bar_time_seconds),
|
||||
SwitchV("status_bar_time_seconds"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_hide_space),
|
||||
TextV(textId = R.string.status_bar_time_hide_space),
|
||||
SwitchV("status_bar_time_hide_space"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_double_line),
|
||||
TextV(textId = R.string.status_bar_time_double_line),
|
||||
SwitchV("status_bar_time_double_line"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.status_bar_time_double_line_center_align),
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_double_line_center_align"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size", 0, 18, 0,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.status_bar_clock_double_line_size,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
textId = R.string.status_bar_clock_double_line_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_double_line_size", 0, 9, 0,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
//预设模式结束
|
||||
|
||||
//极客模式起始
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.custom_clock_format_geek
|
||||
) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.custom_clock_format_geek)
|
||||
setEditText(
|
||||
safeSP.getString(
|
||||
"custom_clock_format_geek", "HH:mm:ss"
|
||||
),
|
||||
""
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
safeSP.putAny("custom_clock_format_geek", getEditText())
|
||||
dismiss()
|
||||
return@setRButton
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(
|
||||
activity,
|
||||
R.string.input_error,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_center_align_geek"),
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size_geek", 0, 18, 0,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
//极客模式结束
|
||||
|
||||
|
||||
Line()
|
||||
TitleText(resId = R.string.status_bar_icon)
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_icon,
|
||||
@@ -301,7 +412,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.show_wifi_standard),
|
||||
TextV(textId = R.string.show_wifi_standard),
|
||||
SwitchV("show_wifi_standard")
|
||||
)
|
||||
val customMobileTypeTextBinding = GetDataBinding(object : DefValue {
|
||||
@@ -499,7 +610,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.maximum_number_of_notification_icons
|
||||
textId = R.string.maximum_number_of_notification_icons
|
||||
)
|
||||
SeekBarWithText(
|
||||
"maximum_number_of_notification_icons",
|
||||
@@ -508,7 +619,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
3
|
||||
)
|
||||
Text(
|
||||
resId = R.string.maximum_number_of_notification_dots
|
||||
textId = R.string.maximum_number_of_notification_dots
|
||||
)
|
||||
SeekBarWithText(
|
||||
"maximum_number_of_notification_dots",
|
||||
@@ -555,7 +666,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("hide_battery_percentage_icon")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.status_bar_network_speed)
|
||||
TitleText(textId = R.string.status_bar_network_speed)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.status_bar_network_speed_refresh_speed,
|
||||
@@ -571,7 +682,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("hide_status_bar_network_speed_second")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_network_speed_splitter),
|
||||
TextV(textId = R.string.hide_network_speed_splitter),
|
||||
SwitchV("hide_network_speed_splitter")
|
||||
)
|
||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding(object : DefValue {
|
||||
@@ -598,7 +709,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
align[0] = getString(R.string.left)
|
||||
align[1] = getString(R.string.right)
|
||||
TextWithSpinner(
|
||||
TextV(resId = R.string.status_bar_network_speed_dual_row_gravity),
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity),
|
||||
SpinnerV(
|
||||
align[safeSP.getInt(
|
||||
"status_bar_network_speed_dual_row_gravity",
|
||||
@@ -616,7 +727,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSpinner(
|
||||
TextV(resId = R.string.status_bar_network_speed_dual_row_icon),
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_icon),
|
||||
SpinnerV(
|
||||
safeSP.getString(
|
||||
"status_bar_network_speed_dual_row_icon",
|
||||
@@ -641,7 +752,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
}
|
||||
)
|
||||
Text(
|
||||
resId = R.string.status_bar_network_speed_dual_row_size,
|
||||
textId = R.string.status_bar_network_speed_dual_row_size,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -652,7 +763,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.notification_center)
|
||||
TitleText(textId = R.string.notification_center)
|
||||
val showWeatherMainSwitchBinding = GetDataBinding(object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getBoolean("notification_weather", false)
|
||||
@@ -687,7 +798,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("can_notification_slide"),
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.control_center)
|
||||
TitleText(textId = R.string.control_center)
|
||||
val controlCenterWeatherBinding = GetDataBinding(object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getBoolean("control_center_weather", false)
|
||||
@@ -717,7 +828,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.lock_screen)
|
||||
TitleText(textId = R.string.lock_screen)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_screen_clock_display_seconds,
|
||||
@@ -759,7 +870,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.old_quick_settings_panel)
|
||||
TitleText(textId = R.string.old_quick_settings_panel)
|
||||
val oldQSCustomSwitchBinding = GetDataBinding(object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
return safeSP.getBoolean("old_qs_custom_switch", false)
|
||||
@@ -781,7 +892,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.qs_custom_rows,
|
||||
textId = R.string.qs_custom_rows,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -792,7 +903,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.qs_custom_rows_horizontal,
|
||||
textId = R.string.qs_custom_rows_horizontal,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -803,7 +914,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.qs_custom_columns,
|
||||
textId = R.string.qs_custom_columns,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -814,7 +925,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
resId = R.string.qs_custom_columns_unexpanded,
|
||||
textId = R.string.qs_custom_columns_unexpanded,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
@@ -826,7 +937,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
}
|
||||
register("scope_android", getString(R.string.scope_android), false) {
|
||||
TitleText(resId = R.string.corepacth)
|
||||
TitleText(textId = R.string.corepacth)
|
||||
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
@@ -923,7 +1034,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("allow_untrusted_touches")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.sound)
|
||||
TitleText(textId = R.string.sound)
|
||||
val mediaVolumeStepsSwitchBinding = GetDataBinding(
|
||||
object : DefValue {
|
||||
override fun getValue(): Any {
|
||||
@@ -954,7 +1065,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
}
|
||||
register("scope_other", getString(R.string.scope_other), false) {
|
||||
TitleText(resId = R.string.scope_miuihome)
|
||||
TitleText(textId = R.string.scope_miuihome)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.home_time,
|
||||
@@ -968,7 +1079,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
), SwitchV("double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.scope_powerkeeper)
|
||||
TitleText(textId = R.string.scope_powerkeeper)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_max_fps,
|
||||
@@ -1003,7 +1114,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.scope_securitycenter)
|
||||
TitleText(textId = R.string.scope_securitycenter)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.skip_waiting_time,
|
||||
@@ -1038,7 +1149,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("battery_life_function")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.scope_mediaeditor)
|
||||
TitleText(textId = R.string.scope_mediaeditor)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.unlock_unlimited_cropping,
|
||||
@@ -1047,7 +1158,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("unlock_unlimited_cropping")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.updater)
|
||||
TitleText(textId = R.string.updater)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_ota_validate,
|
||||
@@ -1056,7 +1167,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("remove_ota_validate")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.settings)
|
||||
TitleText(textId = R.string.settings)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_notification_importance,
|
||||
@@ -1065,7 +1176,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("show_notification_importance")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.cast)
|
||||
TitleText(textId = R.string.cast)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.force_support_send_app,
|
||||
@@ -1073,7 +1184,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("force_support_send_app")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.rear_display)
|
||||
TitleText(textId = R.string.rear_display)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
@@ -1081,7 +1192,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("rear_show_weather")
|
||||
)
|
||||
Line()
|
||||
TitleText(resId = R.string.remove_ad)
|
||||
TitleText(textId = R.string.remove_ad)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_thememanager_ads
|
||||
@@ -1090,106 +1201,106 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
}
|
||||
register("hide_icon", getString(R.string.hide_icon), false) {
|
||||
TitleText(resId = R.string.status_bar_icon)
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_battery_icon),
|
||||
TextV(textId = R.string.hide_battery_icon),
|
||||
SwitchV("hide_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_battery_charging_icon),
|
||||
TextV(textId = R.string.hide_battery_charging_icon),
|
||||
SwitchV("hide_battery_charging_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_gps_icon),
|
||||
TextV(textId = R.string.hide_gps_icon),
|
||||
SwitchV("hide_gps_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_bluetooth_icon),
|
||||
TextV(textId = R.string.hide_bluetooth_icon),
|
||||
SwitchV("hide_bluetooth_icon")
|
||||
)
|
||||
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_nfc_icon),
|
||||
TextV(textId = R.string.hide_nfc_icon),
|
||||
SwitchV("hide_nfc_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_bluetooth_battery_icon),
|
||||
TextV(textId = R.string.hide_bluetooth_battery_icon),
|
||||
SwitchV("hide_bluetooth_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_small_hd_icon),
|
||||
TextV(textId = R.string.hide_small_hd_icon),
|
||||
SwitchV("hide_small_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_big_hd_icon),
|
||||
TextV(textId = R.string.hide_big_hd_icon),
|
||||
SwitchV("hide_big_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_hd_no_service_icon),
|
||||
TextV(textId = R.string.hide_hd_no_service_icon),
|
||||
SwitchV("hide_hd_no_service_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_no_sim_icon),
|
||||
TextV(textId = R.string.hide_no_sim_icon),
|
||||
SwitchV("hide_no_sim_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_sim_one_icon),
|
||||
TextV(textId = R.string.hide_sim_one_icon),
|
||||
SwitchV("hide_sim_one_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_sim_two_icon),
|
||||
TextV(textId = R.string.hide_sim_two_icon),
|
||||
SwitchV("hide_sim_two_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_mobile_activity_icon),
|
||||
TextV(textId = R.string.hide_mobile_activity_icon),
|
||||
SwitchV("hide_mobile_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_mobile_type_icon),
|
||||
TextV(textId = R.string.hide_mobile_type_icon),
|
||||
SwitchV("hide_mobile_type_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_wifi_icon),
|
||||
TextV(textId = R.string.hide_wifi_icon),
|
||||
SwitchV("hide_wifi_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_wifi_activity_icon),
|
||||
TextV(textId = R.string.hide_wifi_activity_icon),
|
||||
SwitchV("hide_wifi_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_wifi_standard_icon),
|
||||
TextV(textId = R.string.hide_wifi_standard_icon),
|
||||
SwitchV("hide_wifi_standard_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_slave_wifi_icon),
|
||||
TextV(textId = R.string.hide_slave_wifi_icon),
|
||||
SwitchV("hide_slave_wifi_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_hotspot_icon),
|
||||
TextV(textId = R.string.hide_hotspot_icon),
|
||||
SwitchV("hide_hotspot_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_vpn_icon),
|
||||
TextV(textId = R.string.hide_vpn_icon),
|
||||
SwitchV("hide_vpn_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_airplane_icon),
|
||||
TextV(textId = R.string.hide_airplane_icon),
|
||||
SwitchV("hide_airplane_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_alarm_icon),
|
||||
TextV(textId = R.string.hide_alarm_icon),
|
||||
SwitchV("hide_alarm_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_headset_icon),
|
||||
TextV(textId = R.string.hide_headset_icon),
|
||||
SwitchV("hide_headset_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_volume_icon),
|
||||
TextV(textId = R.string.hide_volume_icon),
|
||||
SwitchV("hide_volume_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(resId = R.string.hide_zen_icon),
|
||||
TextV(textId = R.string.hide_zen_icon),
|
||||
SwitchV("hide_zen_icon")
|
||||
)
|
||||
}
|
||||
@@ -1198,7 +1309,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
authorHead = getDrawable(R.drawable.app_icon)!!,
|
||||
authorName = getString(R.string.app_name),
|
||||
authorTips = BuildConfig.VERSION_NAME + "(" + BuildConfig.BUILD_TYPE + ")",
|
||||
onClick = {
|
||||
onClickListener = {
|
||||
try {
|
||||
startActivity(
|
||||
Intent(
|
||||
@@ -1221,7 +1332,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
authorHead = getDrawable(R.drawable.lt)!!,
|
||||
authorName = "乌堆小透明",
|
||||
authorTips = "LittleTurtle2333",
|
||||
onClick = {
|
||||
onClickListener = {
|
||||
try {
|
||||
startActivity(
|
||||
Intent(
|
||||
|
||||
@@ -10,7 +10,7 @@ object UnlockUnlimitedCropping : HookRegister() {
|
||||
override fun init() {
|
||||
//截图无限裁切
|
||||
findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b") {
|
||||
name == "a"
|
||||
name == "a" && parameterCount == 0 && returnType == Int::class.java
|
||||
}.hookBefore {
|
||||
hasEnable("unlock_unlimited_cropping") {
|
||||
it.result = 0
|
||||
|
||||
@@ -11,15 +11,16 @@ import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import cn.fkj233.ui.activity.dp2px
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
|
||||
object StatusBarLayout : HookRegister() {
|
||||
|
||||
private val getMode = XSPUtils.getInt("status_bar_layout_mode", 0)
|
||||
private val getHoleLocation = XSPUtils.getInt("screen_hole_location", 0)
|
||||
|
||||
private var statusBarLeft = 0
|
||||
private var statusBarTop = 0
|
||||
private var statusBarRight = 0
|
||||
@@ -46,7 +47,16 @@ object StatusBarLayout : HookRegister() {
|
||||
}
|
||||
}
|
||||
|
||||
when (XSPUtils.getInt("status_bar_layout_mode", 0)) {
|
||||
//判断是否开启居中挖孔兼容模式
|
||||
if (getHoleLocation == 1) {
|
||||
findMethod("com.android.systemui.ScreenDecorations\$DisplayCutoutView") {
|
||||
name == "boundsFromDirection" && parameterCount == 3 && isStatic
|
||||
}.hookBefore {
|
||||
it.args[1] = 0
|
||||
}
|
||||
}
|
||||
|
||||
when (getMode) {
|
||||
//默认
|
||||
0 -> return
|
||||
//时钟居中
|
||||
@@ -150,7 +160,7 @@ object StatusBarLayout : HookRegister() {
|
||||
statusBarBottom = statusBar!!.paddingBottom
|
||||
|
||||
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
if (getHoleLocation == 2) {
|
||||
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||
if (customLeftMargin != 0) {
|
||||
statusBarLeft = customLeftMargin
|
||||
@@ -365,7 +375,7 @@ object StatusBarLayout : HookRegister() {
|
||||
statusBarBottom = statusBar!!.paddingBottom
|
||||
|
||||
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
if (getHoleLocation == 2) {
|
||||
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||
if (customLeftMargin != 0) {
|
||||
statusBarLeft = customLeftMargin
|
||||
@@ -382,7 +392,7 @@ object StatusBarLayout : HookRegister() {
|
||||
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") {
|
||||
name == "updateLayoutForCutout"
|
||||
}.hookAfter {
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
if (getHoleLocation == 2) {
|
||||
val context = (it.thisObject as ViewGroup).context
|
||||
updateLayout(context)
|
||||
}
|
||||
@@ -409,5 +419,4 @@ object StatusBarLayout : HookRegister() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,9 @@ import java.util.*
|
||||
|
||||
object StatusBarTimeCustomization : HookRegister() {
|
||||
|
||||
private val getMode = XSPUtils.getInt("custom_clock_mode", 0)
|
||||
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
||||
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
|
||||
private val isYear = XSPUtils.getBoolean("status_bar_time_year", false)
|
||||
private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false)
|
||||
private val isDay = XSPUtils.getBoolean("status_bar_time_day", false)
|
||||
@@ -27,85 +30,160 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
private val isSecond = XSPUtils.getBoolean("status_bar_time_seconds", false)
|
||||
private val isDoubleHour = XSPUtils.getBoolean("status_bar_time_double_hour", false)
|
||||
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
||||
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
||||
private val isOpen = XSPUtils.getBoolean("custom_clock_switch", false)
|
||||
private val isCenterAlign =
|
||||
XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
|
||||
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 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 isGeekCenterAlign =
|
||||
XSPUtils.getBoolean("status_bar_time_center_align_geek", false)
|
||||
|
||||
private lateinit var nowTime: Date
|
||||
private var str = ""
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun init() {
|
||||
if (isOpen) {
|
||||
var c: Context? = null
|
||||
when (getMode) {
|
||||
//预设模式
|
||||
1 -> {
|
||||
var c: Context? = null
|
||||
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
try {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
|
||||
textV.isSingleLine = false
|
||||
if (isDoubleLine) {
|
||||
str = "\n"
|
||||
var clockDoubleLineSize = 7F
|
||||
if (getClockDoubleSize != 0) {
|
||||
clockDoubleLineSize = getClockDoubleSize.toFloat()
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
try {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
|
||||
textV.isSingleLine = false
|
||||
if (isDoubleLine) {
|
||||
str = "\n"
|
||||
var clockDoubleLineSize = 7F
|
||||
if (getClockDoubleSize != 0) {
|
||||
clockDoubleLineSize = getClockDoubleSize.toFloat()
|
||||
}
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockDoubleLineSize)
|
||||
textV.setLineSpacing(0F, 0.8F)
|
||||
} else {
|
||||
if (getClockSize != 0) {
|
||||
val clockSize = getClockSize.toFloat()
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
|
||||
}
|
||||
}
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockDoubleLineSize)
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
val r = Runnable {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
|
||||
class T : TimerTask() {
|
||||
override fun run() {
|
||||
Handler(textV.context.mainLooper).post(r)
|
||||
}
|
||||
}
|
||||
Timer().scheduleAtFixedRate(
|
||||
T(),
|
||||
1000 - System.currentTimeMillis() % 1000,
|
||||
1000
|
||||
)
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
name == "updateTime"
|
||||
}.hookAfter {
|
||||
try {
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||
val t = Settings.System.getString(
|
||||
c!!.contentResolver,
|
||||
Settings.System.TIME_12_24
|
||||
)
|
||||
val is24 = t == "24"
|
||||
nowTime = Calendar.getInstance().time
|
||||
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isCenterAlign) {
|
||||
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||
name == "onViewCreated" && parameterCount == 2
|
||||
}.hookAfter {
|
||||
val miuiPhoneStatusBarView =
|
||||
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||
val res: Resources = miuiPhoneStatusBarView.resources
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
|
||||
clock.gravity = Gravity.CENTER
|
||||
}
|
||||
}
|
||||
}
|
||||
//极客模式
|
||||
2 -> {
|
||||
var c: Context? = null
|
||||
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
try {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter
|
||||
textV.isSingleLine = false
|
||||
textV.setLineSpacing(0F, 0.8F)
|
||||
} else {
|
||||
if (getClockSize != 0) {
|
||||
val clockSize = getClockSize.toFloat()
|
||||
if (getGeekClockSize != 0) {
|
||||
val clockSize = getGeekClockSize.toFloat()
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
|
||||
}
|
||||
}
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
val r = Runnable {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
|
||||
class T : TimerTask() {
|
||||
override fun run() {
|
||||
Handler(textV.context.mainLooper).post(r)
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
val r = Runnable {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
}
|
||||
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
name == "updateTime"
|
||||
}.hookAfter {
|
||||
try {
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||
val t = Settings.System.getString(
|
||||
c!!.contentResolver,
|
||||
Settings.System.TIME_12_24
|
||||
class T : TimerTask() {
|
||||
override fun run() {
|
||||
Handler(textV.context.mainLooper).post(r)
|
||||
}
|
||||
}
|
||||
Timer().scheduleAtFixedRate(
|
||||
T(),
|
||||
1000 - System.currentTimeMillis() % 1000,
|
||||
1000
|
||||
)
|
||||
val is24 = t == "24"
|
||||
nowTime = Calendar.getInstance().time
|
||||
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isCenterAlign) {
|
||||
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||
name == "onViewCreated" && parameterCount == 2
|
||||
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
name == "updateTime"
|
||||
}.hookAfter {
|
||||
val miuiPhoneStatusBarView =
|
||||
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||
val res: Resources = miuiPhoneStatusBarView.resources
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
|
||||
clock.gravity = Gravity.CENTER
|
||||
try {
|
||||
val textV = it.thisObject as TextView
|
||||
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
|
||||
nowTime = Calendar.getInstance().time
|
||||
textV.text = SimpleDateFormat(getGeekFormat).format(nowTime)
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isGeekCenterAlign) {
|
||||
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||
name == "onViewCreated" && parameterCount == 2
|
||||
}.hookAfter {
|
||||
val miuiPhoneStatusBarView =
|
||||
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||
val res: Resources = miuiPhoneStatusBarView.resources
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
|
||||
clock.gravity = Gravity.CENTER
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,4 +218,12 @@
|
||||
<string name="take_effect_after_reboot">Intră în vigoare după repornire</string>
|
||||
<string name="media_volume_steps_summary">Activarea poate provoca înghețarea derulării barei de volum sau volumul Bluetooth să fie anormal</string>
|
||||
<string name="can_notification_slide_summary">Este posibil ca unele notificări prin Mi Push să nu fie acceptate.</string>
|
||||
<string name="screen_hole_location">Locație gaură ecran</string>
|
||||
<string name="custom_clock_mode">Mod ceas personalizat</string>
|
||||
<string name="custom_clock_format_geek">Format ceas</string>
|
||||
<string name="off">Oprit</string>
|
||||
<string name="center">La centru</string>
|
||||
<string name="left_or_right">Stânga sau dreapta</string>
|
||||
<string name="preset">Presetare</string>
|
||||
<string name="geek">Tocilar</string>
|
||||
</resources>
|
||||
|
||||
@@ -218,4 +218,12 @@
|
||||
<string name="take_effect_after_reboot">重新启动后生效</string>
|
||||
<string name="media_volume_steps_summary">打开可能会导致音量条的滚动卡顿或蓝牙音量异常。</string>
|
||||
<string name="can_notification_slide_summary">一些通过Mi Push推送的通知可能不受支持</string>
|
||||
<string name="screen_hole_location">屏幕挖孔位置</string>
|
||||
<string name="custom_clock_mode">自定义时钟模式</string>
|
||||
<string name="custom_clock_format_geek">时钟格式</string>
|
||||
<string name="off">关闭</string>
|
||||
<string name="center">中间</string>
|
||||
<string name="left_or_right">左右</string>
|
||||
<string name="preset">预设</string>
|
||||
<string name="geek">极客</string>
|
||||
</resources>
|
||||
|
||||
@@ -218,4 +218,10 @@
|
||||
<string name="take_effect_after_reboot">重新開機後生效</string>
|
||||
<string name="media_volume_steps_summary">開啟後可能會導致音量條的滾動卡頓或藍牙音量異常</string>
|
||||
<string name="can_notification_slide_summary">可能無法支援一些使用小米推送(Mi Push)推播的通知</string>
|
||||
<string name="screen_hole_location">螢幕挖孔位置</string>
|
||||
<string name="custom_clock_mode">自訂時鐘模式</string>
|
||||
<string name="custom_clock_format_geek">時鐘格式</string>
|
||||
<string name="off">關閉</string>
|
||||
<string name="center">置中</string>
|
||||
<string name="left_or_right">左右</string>
|
||||
</resources>
|
||||
|
||||
@@ -222,4 +222,12 @@
|
||||
<string name="take_effect_after_reboot">Take effect after reboot</string>
|
||||
<string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string>
|
||||
<string name="can_notification_slide_summary">Some notifications through Mi Push may not be supported.</string>
|
||||
<string name="screen_hole_location">Screen hole location</string>
|
||||
<string name="custom_clock_mode">Custom clock mode</string>
|
||||
<string name="custom_clock_format_geek">Clock format</string>
|
||||
<string name="off">Off</string>
|
||||
<string name="center">Center</string>
|
||||
<string name="left_or_right">Left or Right</string>
|
||||
<string name="preset">Preset</string>
|
||||
<string name="geek">Geek</string>
|
||||
</resources>
|
||||
|
||||
Submodule blockmiui updated: a02e4a13b3...fbaed7f8ed
@@ -5,8 +5,8 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools.build:gradle:7.2.0")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
|
||||
classpath("com.android.tools.build:gradle:7.2.1")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0")
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle.kts files
|
||||
|
||||
Reference in New Issue
Block a user