mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
修复A13控制中心时钟对齐问题
This commit is contained in:
@@ -107,9 +107,15 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||||
paramCount == 3
|
paramCount == 3
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
c = it.args[0] as Context
|
try {
|
||||||
val textV = it.thisObject as TextView
|
val textV = it.thisObject as TextView
|
||||||
textV.gravity = Gravity.CENTER
|
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") {
|
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||||
paramCount == 3
|
paramCount == 3
|
||||||
}.hookAfter {
|
}.hookAfter {
|
||||||
c = it.args[0] as Context
|
try {
|
||||||
val textV = it.thisObject as TextView
|
val textV = it.thisObject as TextView
|
||||||
textV.gravity = Gravity.CENTER
|
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 (isYear) {
|
||||||
if (isZh) {
|
if (isZh) {
|
||||||
datePattern += "YY年"
|
datePattern += "YY年"
|
||||||
// if (!isHideSpace) datePattern = "$datePattern "
|
|
||||||
} else {
|
} else {
|
||||||
datePattern += "YY"
|
datePattern += "YY"
|
||||||
if (isMonth || isDay) datePattern += "/"
|
if (isMonth || isDay) datePattern += "/"
|
||||||
@@ -200,7 +211,6 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
|||||||
if (isMonth) {
|
if (isMonth) {
|
||||||
if (isZh) {
|
if (isZh) {
|
||||||
datePattern += "M月"
|
datePattern += "M月"
|
||||||
// if (!isHideSpace) datePattern = "$datePattern "
|
|
||||||
} else {
|
} else {
|
||||||
datePattern += "M"
|
datePattern += "M"
|
||||||
if (isDay) datePattern += "/"
|
if (isDay) datePattern += "/"
|
||||||
|
|||||||
Reference in New Issue
Block a user