Skip to content

Commit 99ae8fd

Browse files
committed
Optimization: When setting a double-row status bar clock and the custom notification bar mini clock is empty, the double-row status bar will preset a style(Only HyperOS)
Signed-off-by: Neko Qiqi <lingqiqi233@gmail.com>
1 parent 6964ae6 commit 99ae8fd

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/statusbar/clock/StatusBarClockNew.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,18 @@ object StatusBarClockNew : BaseHook() {
254254

255255
private fun setMiuiClockFormat(context: Context?, name: String, textV: TextView) {
256256
// 因为输入对话框限制,所以里面部分内容会比较抽象
257-
val sClockName = when (getClockStyle) {
258-
0 -> getFormatS.split("\n")[0]
259-
1 -> "${getFormatS.split("\n")[0]}\n${getFormatN.split("\n")[0]}"
260-
else -> "${getFormatN.split("\n")[0]}\n${getFormatS.split("\n")[0]}"
257+
val sClockName = if (getFormatN.isEmpty()) {
258+
when (getClockStyle) {
259+
0 -> getFormatS.split("\n")[0]
260+
1 -> "${getFormatS.split("\n")[0]}\nM/d E"
261+
else -> "M/d E\n${getFormatS.split("\n")[0]}"
262+
}
263+
} else {
264+
when (getClockStyle) {
265+
0 -> getFormatS.split("\n")[0]
266+
1 -> "${getFormatS.split("\n")[0]}\n${getFormatN.split("\n")[0]}"
267+
else -> "${getFormatN.split("\n")[0]}\n${getFormatS.split("\n")[0]}"
268+
}
261269
}
262270

263271
val mMiuiStatusBarClockController =

0 commit comments

Comments
 (0)