mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
修复A13控制中心时钟对齐问题
This commit is contained in:
@@ -107,9 +107,15 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
textV.gravity = Gravity.CENTER
|
||||
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,9 +180,15 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
textV.gravity = Gravity.CENTER
|
||||
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 += "/"
|
||||
|
||||
Reference in New Issue
Block a user