修复A13控制中心时钟对齐问题

This commit is contained in:
LittleTurtle2333
2023-02-17 23:07:44 +08:00
parent 8fe9d09624
commit 99da21e762

View File

@@ -107,10 +107,16 @@ object StatusBarTimeCustomizationForT : HookRegister() {
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
paramCount == 3
}.hookAfter {
try {
val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
c = it.args[0] as Context
val textV = it.thisObject as TextView
textV.gravity = Gravity.CENTER
}
} catch (_: Exception) {
}
}
}
}
//极客模式
@@ -174,10 +180,16 @@ object StatusBarTimeCustomizationForT : HookRegister() {
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
paramCount == 3
}.hookAfter {
try {
val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) == "clock") {
c = it.args[0] as Context
val textV = it.thisObject as TextView
textV.gravity = Gravity.CENTER
}
} catch (_: Exception) {
}
}
}
}
}
@@ -191,7 +203,6 @@ object StatusBarTimeCustomizationForT : HookRegister() {
if (isYear) {
if (isZh) {
datePattern += "YY年"
// if (!isHideSpace) datePattern = "$datePattern "
} else {
datePattern += "YY"
if (isMonth || isDay) datePattern += "/"
@@ -200,7 +211,6 @@ object StatusBarTimeCustomizationForT : HookRegister() {
if (isMonth) {
if (isZh) {
datePattern += "M月"
// if (!isHideSpace) datePattern = "$datePattern "
} else {
datePattern += "M"
if (isDay) datePattern += "/"