Compare commits

22 Commits

Author SHA1 Message Date
乌堆小透明
068eab0cc8 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-05-12 21:56:53 +08:00
乌堆小透明
2fc199c7f2 New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-05-12 20:44:55 +08:00
乌堆小透明
aa59a61588 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-05-12 20:44:53 +08:00
乌堆小透明
dfc217d67f New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-05-12 20:44:52 +08:00
乌堆小透明
a20a36674a New translations strings.xml (Chinese Traditional, Hong Kong)
[ci skip] New translations from Crowdin
2022-05-12 19:35:29 +08:00
乌堆小透明
48d9de0535 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-05-12 19:35:27 +08:00
乌堆小透明
9efa453a25 New translations strings.xml (French)
[ci skip] New translations from Crowdin
2022-05-12 19:35:26 +08:00
乌堆小透明
8b076cc349 New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-05-12 19:35:24 +08:00
乌堆小透明
df2dbb7270 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-05-12 19:35:15 +08:00
乌堆小透明
910861722b New translations strings.xml (Dutch)
[ci skip] New translations from Crowdin
2022-05-12 19:35:12 +08:00
乌堆小透明
4d8b748711 New translations strings.xml (Polish)
[ci skip] New translations from Crowdin
2022-05-12 19:35:11 +08:00
乌堆小透明
fd4952e41d New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-05-12 19:35:10 +08:00
乌堆小透明
45f97315a2 New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-05-12 19:35:09 +08:00
乌堆小透明
9dc6f4f447 New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-05-12 19:35:06 +08:00
乌堆小透明
cb16367bb9 New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-05-12 19:35:04 +08:00
乌堆小透明
421d073d67 New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-05-12 19:35:02 +08:00
乌堆小透明
deb8103352 New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin
2022-05-12 19:35:00 +08:00
乌堆小透明
e6e3321110 New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-05-12 19:34:58 +08:00
乌堆小透明
62f6814ee8 New translations strings.xml (Indonesian)
[ci skip] New translations from Crowdin
2022-05-12 19:34:57 +08:00
GSWXXN
2a94e1da69 显示电池温度适配新版手机管家&新增隐藏NFC图标 (#163) 2022-05-12 18:48:31 +08:00
乌堆小透明
94beae5f45 New Crowdin updates (#152)
* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Italian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Hungarian)
[ci skip] New translations from Crowdin
2022-05-12 18:35:01 +08:00
LittleTurtle2333
a63fd5510a update blockmiui 2022-04-23 21:26:22 +08:00
10 changed files with 120 additions and 158 deletions

View File

@@ -10,7 +10,6 @@ import android.view.View
import android.widget.Switch
import android.widget.Toast
import cn.fkj233.ui.activity.MIUIActivity
import cn.fkj233.ui.activity.OwnSP
import cn.fkj233.ui.activity.data.DefValue
import cn.fkj233.ui.activity.view.SpinnerV
import cn.fkj233.ui.activity.view.SwitchV
@@ -145,53 +144,29 @@ class SettingsActivity : MIUIActivity() {
TextWithSpinner(
TextV(resId = R.string.status_bar_layout_mode),
SpinnerV(
statusBarLayoutMode[OwnSP.ownSP.getInt(
statusBarLayoutMode[safeSP.getInt(
"status_bar_layout_mode",
0
)].toString()
) {
add(statusBarLayoutMode[0].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_layout_mode",
0
)
apply()
}
safeSP.putAny("status_bar_layout_mode", 0)
}
add(statusBarLayoutMode[1].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_layout_mode",
1
)
apply()
}
safeSP.putAny("status_bar_layout_mode", 1)
}
add(statusBarLayoutMode[2].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_layout_mode",
2
)
apply()
}
safeSP.putAny("status_bar_layout_mode", 2)
}
add(statusBarLayoutMode[3].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_layout_mode",
3
)
apply()
}
safeSP.putAny("status_bar_layout_mode", 3)
}
}
)
val layoutCompatibilityModeBinding = GetDataBinding(
object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("layout_compatibility_mode", false)
return safeSP.getBoolean("layout_compatibility_mode", false)
}
}
) { view, flags, data ->
@@ -236,7 +211,7 @@ class SettingsActivity : MIUIActivity() {
TitleText(resId = R.string.status_bar_clock_format)
val customClockBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("custom_clock_switch", false)
return safeSP.getBoolean("custom_clock_switch", false)
}
}) { view, flags, data ->
when (flags) {
@@ -327,7 +302,7 @@ class SettingsActivity : MIUIActivity() {
)
val customMobileTypeTextBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("custom_mobile_type_text_switch", false)
return safeSP.getBoolean("custom_mobile_type_text_switch", false)
}
}) { view, flags, data ->
when (flags) {
@@ -351,11 +326,9 @@ class SettingsActivity : MIUIActivity() {
MIUIDialog(activity) {
setTitle(R.string.custom_mobile_type_text)
setEditText(
"${
OwnSP.ownSP.getString(
safeSP.getString(
"custom_mobile_type_text", "5G"
)
}",
),
""
)
setLButton(textId = R.string.cancel) {
@@ -364,13 +337,7 @@ class SettingsActivity : MIUIActivity() {
setRButton(textId = R.string.Done) {
if (getEditText().isNotEmpty()) {
try {
OwnSP.ownSP.edit().run {
putString(
"custom_mobile_type_text",
getEditText()
)
apply()
}
safeSP.putAny("custom_mobile_type_text", getEditText())
dismiss()
return@setRButton
} catch (_: Throwable) {
@@ -387,7 +354,7 @@ class SettingsActivity : MIUIActivity() {
)
val bigMobileTypeIconBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("big_mobile_type_icon", false)
return safeSP.getBoolean("big_mobile_type_icon", false)
}
}) { view, flags, data ->
when (flags) {
@@ -420,7 +387,7 @@ class SettingsActivity : MIUIActivity() {
setEditText(
"",
"${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
OwnSP.ownSP.getFloat(
safeSP.getFloat(
"big_mobile_type_icon_size",
12.5f
)
@@ -431,13 +398,10 @@ class SettingsActivity : MIUIActivity() {
}
setRButton(textId = R.string.Done) {
if (getEditText() != "") {
OwnSP.ownSP.edit().run {
putFloat(
safeSP.putAny(
"big_mobile_type_icon_size",
getEditText().toFloat()
)
apply()
}
}
dismiss()
}
@@ -454,7 +418,7 @@ class SettingsActivity : MIUIActivity() {
setEditText(
"",
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
OwnSP.ownSP.getInt(
safeSP.getInt(
"big_mobile_type_icon_up_and_down_position",
0
)
@@ -468,13 +432,10 @@ class SettingsActivity : MIUIActivity() {
try {
val value = getEditText().toInt()
if (value in (-15..15)) {
OwnSP.ownSP.edit().run {
putInt(
safeSP.putAny(
"big_mobile_type_icon_up_and_down_position",
value
)
apply()
}
dismiss()
return@setRButton
}
@@ -500,7 +461,7 @@ class SettingsActivity : MIUIActivity() {
setEditText(
"",
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
OwnSP.ownSP.getInt(
safeSP.getInt(
"big_mobile_type_icon_left_and_right_margins",
0
)
@@ -514,13 +475,10 @@ class SettingsActivity : MIUIActivity() {
try {
val value = getEditText().toInt()
if (value in (0..30)) {
OwnSP.ownSP.edit().run {
putInt(
safeSP.putAny(
"big_mobile_type_icon_left_and_right_margins",
value
)
apply()
}
dismiss()
return@setRButton
}
@@ -564,7 +522,7 @@ class SettingsActivity : MIUIActivity() {
setEditText(
"",
"${activity.getString(R.string.current)}${
OwnSP.ownSP.getFloat(
safeSP.getFloat(
"battery_percentage_font_size",
0f
)
@@ -575,13 +533,10 @@ class SettingsActivity : MIUIActivity() {
}
setRButton(textId = R.string.Done) {
if (getEditText() != "") {
OwnSP.ownSP.edit().run {
putFloat(
safeSP.putAny(
"battery_percentage_font_size",
getEditText().toFloat()
)
apply()
}
}
dismiss()
}
@@ -617,7 +572,7 @@ class SettingsActivity : MIUIActivity() {
)
val statusBarDualRowNetworkSpeedBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("status_bar_dual_row_network_speed", false)
return safeSP.getBoolean("status_bar_dual_row_network_speed", false)
}
}) { view, flags, data ->
when (flags) {
@@ -641,28 +596,17 @@ class SettingsActivity : MIUIActivity() {
TextWithSpinner(
TextV(resId = R.string.status_bar_network_speed_dual_row_gravity),
SpinnerV(
align[OwnSP.ownSP.getInt(
align[safeSP.getInt(
"status_bar_network_speed_dual_row_gravity",
0
)].toString()
) {
add(align[0].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_network_speed_dual_row_gravity",
0
)
apply()
}
safeSP.putAny("status_bar_network_speed_dual_row_gravity", 0)
}
add(align[1].toString()) {
OwnSP.ownSP.edit().run {
putInt(
"status_bar_network_speed_dual_row_gravity",
1
)
apply()
}
safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
}
},
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
@@ -670,39 +614,25 @@ class SettingsActivity : MIUIActivity() {
TextWithSpinner(
TextV(resId = R.string.status_bar_network_speed_dual_row_icon),
SpinnerV(
"${
OwnSP.ownSP.getString(
safeSP.getString(
"status_bar_network_speed_dual_row_icon",
getString(R.string.none)
)
}"
) {
add(getString(R.string.none)) {
OwnSP.ownSP.edit().run {
putString(
safeSP.putAny(
"status_bar_network_speed_dual_row_icon",
getString(R.string.none)
)
apply()
}
}
add("▲▼") {
OwnSP.ownSP.edit().run {
putString("status_bar_network_speed_dual_row_icon", "▲▼")
apply()
}
safeSP.putAny("status_bar_network_speed_dual_row_icon", "▲▼")
}
add("△▽") {
OwnSP.ownSP.edit().run {
putString("status_bar_network_speed_dual_row_icon", "△▽")
apply()
}
safeSP.putAny("status_bar_network_speed_dual_row_icon", "△▽")
}
add("↑↓") {
OwnSP.ownSP.edit().run {
putString("status_bar_network_speed_dual_row_icon", "↑↓")
apply()
}
safeSP.putAny("status_bar_network_speed_dual_row_icon", "↑↓")
}
}
)
@@ -721,7 +651,7 @@ class SettingsActivity : MIUIActivity() {
TitleText(resId = R.string.notification_center)
val showWeatherMainSwitchBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("notification_weather", false)
return safeSP.getBoolean("notification_weather", false)
}
}) { view, flags, data ->
when (flags) {
@@ -756,7 +686,7 @@ class SettingsActivity : MIUIActivity() {
TitleText(resId = R.string.control_center)
val controlCenterWeatherBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("control_center_weather", false)
return safeSP.getBoolean("control_center_weather", false)
}
}) { view, flags, data ->
when (flags) {
@@ -828,7 +758,7 @@ class SettingsActivity : MIUIActivity() {
TitleText(resId = R.string.old_quick_settings_panel)
val oldQSCustomSwitchBinding = GetDataBinding(object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("old_qs_custom_switch", false)
return safeSP.getBoolean("old_qs_custom_switch", false)
}
}) { view, flags, data ->
when (flags) {
@@ -960,7 +890,7 @@ class SettingsActivity : MIUIActivity() {
setEditText(
"",
"${activity.getString(R.string.def)}1.1, ${activity.getString(R.string.current)}${
OwnSP.ownSP.getFloat(
safeSP.getFloat(
"max_wallpaper_scale",
1.1f
)
@@ -971,10 +901,10 @@ class SettingsActivity : MIUIActivity() {
}
setRButton(textId = R.string.Done) {
if (getEditText() != "") {
OwnSP.ownSP.edit().run {
putFloat("max_wallpaper_scale", getEditText().toFloat())
apply()
}
safeSP.putAny(
"max_wallpaper_scale",
getEditText().toFloat()
)
}
dismiss()
}
@@ -993,7 +923,7 @@ class SettingsActivity : MIUIActivity() {
val mediaVolumeStepsSwitchBinding = GetDataBinding(
object : DefValue {
override fun getValue(): Any {
return getSP().getBoolean("media_volume_steps_switch", false)
return safeSP.getBoolean("media_volume_steps_switch", false)
}
}
) { view, flags, data ->
@@ -1173,6 +1103,11 @@ class SettingsActivity : MIUIActivity() {
TextV(resId = R.string.hide_bluetooth_icon),
SwitchV("hide_bluetooth_icon")
)
TextWithSwitch(
TextV(resId = R.string.hide_nfc_icon),
SwitchV("hide_nfc_icon")
)
TextWithSwitch(
TextV(resId = R.string.hide_bluetooth_battery_icon),
SwitchV("hide_bluetooth_battery_icon")

View File

@@ -14,12 +14,11 @@ import android.widget.LinearLayout
import android.widget.TextView
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.hookBefore
import com.github.kyuubiran.ezxhelper.utils.loadClass
import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.lang.reflect.Field
object ShowBatteryTemperature : HookRegister() {
@@ -31,15 +30,26 @@ object ShowBatteryTemperature : HookRegister() {
}
override fun init() = hasEnable("battery_life_function") {
try {
findMethod("com.miui.powercenter.a") {
name == "b" && parameterTypes[0] == Context::class.java
}
} catch (e : Exception) {
findMethod("com.miui.powercenter.BatteryFragment") {
name == "b" && parameterTypes[0] == Context::class.java
}
}.hookBefore {
it.result = getBatteryTemperature(it.args[0] as Context).toString()
}
try {
findMethod("com.miui.powercenter.a\$a") {
name == "run"
}
} catch (e : Exception) {
findMethod("com.miui.powercenter.BatteryFragment\$a") {
name == "run"
}
}.hookAfter {
val context = AndroidAppHelper.currentApplication().applicationContext
val isDarkMode =
@@ -49,36 +59,43 @@ object ShowBatteryTemperature : HookRegister() {
"id",
"com.miui.securitycenter"
)
val field = loadClass("com.miui.powercenter.a\$a").getDeclaredField("a") as Field
field.isAccessible = true
val view = field.get(it.thisObject) as View
val view = it.thisObject.getObjectAs<View>("a")
val textView = view.findViewById<TextView>(currentTemperatureValue)
(textView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
(textView.layoutParams as LinearLayout.LayoutParams).topMargin = 0
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
textView.setPadding(0, 0, 0, 0)
textView.gravity = Gravity.NO_GRAVITY
textView.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
textView.height = dp2px(context, 49.099983f)
textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
textView.apply {
(layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
(layoutParams as LinearLayout.LayoutParams).topMargin = 0
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
setPadding(0, 0, 0, 0)
gravity = Gravity.NO_GRAVITY
typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
height = dp2px(context, 49.099983f)
textAlignment = View.TEXT_ALIGNMENT_VIEW_START
}
val tempView = TextView(context)
tempView.layoutParams = LinearLayout.LayoutParams(
tempView.apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
dp2px(context, 49.099983f)
)
(tempView.layoutParams as LinearLayout.LayoutParams).marginStart =
(layoutParams as LinearLayout.LayoutParams).marginStart =
dp2px(context, 3.599976f)
tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
tempView.setPadding(0, dp2px(context, 25f), 0, 0)
tempView.text = ""
tempView.typeface = Typeface.create(null, 500, false)
tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
setPadding(0, dp2px(context, 25f), 0, 0)
text = ""
typeface = Typeface.create(null, 500, false)
textAlignment = View.TEXT_ALIGNMENT_VIEW_START
}
val tempeValueContainer = context.resources.getIdentifier(
"tempe_value_container",
"id",
"com.miui.securitycenter"
)
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
linearLayout.addView(tempView)
}

View File

@@ -76,6 +76,10 @@ object HideStatusBarIcon : HookRegister() {
"no_sim" -> hasEnable("hide_no_sim_icon") {
it.args[1] = false
}
//隐藏NFC图标
"nfc" -> hasEnable("hide_nfc_icon") {
it.args[1] = false
}
}
}
}

View File

@@ -26,6 +26,7 @@
<string name="hide_hotspot_icon">Ocultar icono de punto de accesos inalámbrico</string>
<string name="hide_headset_icon">Ocultar icono de audífonos</string>
<string name="hide_bluetooth_battery_icon">Ocultar icono de batería de Bluetooth</string>
<string name="hide_nfc_icon">Ocultar icono de NFC</string>
<string name="hide_big_hd_icon">Ocultar icono grande HD</string>
<string name="hide_small_hd_icon">Ocultar icono pequeño HD</string>
<string name="hide_hd_no_service_icon">Ocultar icono sin servicio HD</string>

View File

@@ -26,6 +26,7 @@
<string name="hide_hotspot_icon">ポータブルホットスポットアイコンを隠す</string>
<string name="hide_headset_icon">ヘッドセットアイコンを隠す</string>
<string name="hide_bluetooth_battery_icon">Bluetooth機器のバッテリーアイコンを非表示</string>
<string name="hide_nfc_icon">NFC アイコンを隠す</string>
<string name="hide_big_hd_icon">大きなHDアイコンを隠す</string>
<string name="hide_small_hd_icon">小さいHDアイコンを隠す</string>
<string name="hide_hd_no_service_icon">HD サービスなしアイコンを隠す</string>

View File

@@ -26,6 +26,7 @@
<string name="hide_hotspot_icon">Ascunde pictograma Hotspot mobil</string>
<string name="hide_headset_icon">Ascunde pictograma căștilor</string>
<string name="hide_bluetooth_battery_icon">Ascunde pictograma Baterie Bluetooth</string>
<string name="hide_nfc_icon">Ascunde pictograma NFC</string>
<string name="hide_big_hd_icon">Ascunde pictograma HD mare</string>
<string name="hide_small_hd_icon">Ascunde pictograma HD mic</string>
<string name="hide_hd_no_service_icon">Ascunde pictograma Fără servicii HD</string>

View File

@@ -26,6 +26,7 @@
<string name="hide_hotspot_icon">Скрыть точку доступа</string>
<string name="hide_headset_icon">Скрыть гарнитуру</string>
<string name="hide_bluetooth_battery_icon">Скрыть батарею блютуз устройства</string>
<string name="hide_nfc_icon">Скрыть иконку NFC</string>
<string name="hide_big_hd_icon">Скрыть большую иконку HD</string>
<string name="hide_small_hd_icon">Скрыть маленькую иконку HD</string>
<string name="hide_hd_no_service_icon">Скрыть HD No Service</string>

View File

@@ -26,6 +26,7 @@
<string name="hide_hotspot_icon">隱藏 WIFI熱點 圖示</string>
<string name="hide_headset_icon">隱藏 耳機 圖示</string>
<string name="hide_bluetooth_battery_icon">隱藏 藍牙電量 圖示</string>
<string name="hide_nfc_icon">隱藏 NFC 圖示</string>
<string name="hide_big_hd_icon">隱藏 大HD 圖示</string>
<string name="hide_small_hd_icon">隱藏 小HD 圖示</string>
<string name="hide_hd_no_service_icon">隱藏 HD無服務 圖示</string>

View File

@@ -28,6 +28,7 @@
<string name="hide_hotspot_icon">Hide Portable hotspot icon</string>
<string name="hide_headset_icon">Hide Headset icon</string>
<string name="hide_bluetooth_battery_icon">Hide Bluetooth battery icon</string>
<string name="hide_nfc_icon">Hide NFC icon</string>
<string name="hide_big_hd_icon">Hide big HD icon</string>
<string name="hide_small_hd_icon">Hide small HD icon</string>
<string name="hide_hd_no_service_icon">Hide HD No Service icon</string>