mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
新增状态栏时钟双排显示
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
versionCode = 19
|
||||
versionName = "1.1.8"
|
||||
versionCode = 20
|
||||
versionName = "1.1.9"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -162,6 +162,12 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("status_bar_time_hide_space")
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_double_line),
|
||||
SwitchV("status_bar_time_double_line")
|
||||
)
|
||||
)
|
||||
add(LineV())
|
||||
add(TitleTextV(resId = R.string.status_bar_icon))
|
||||
add(
|
||||
|
||||
@@ -34,6 +34,7 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
override fun afterHookedMethod(param: MethodHookParam) {
|
||||
c = param.args[0] as Context
|
||||
val textV = param.thisObject as TextView
|
||||
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
val r = Runnable {
|
||||
d.isAccessible = true
|
||||
@@ -65,8 +66,17 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
Settings.System.TIME_12_24
|
||||
)
|
||||
now_time = Calendar.getInstance().time
|
||||
var str = ""
|
||||
if (XSPUtils.getBoolean("status_bar_time_double_line", false)) {
|
||||
textV.isSingleLine = false
|
||||
textV.textSize = 7F
|
||||
str = "\n"
|
||||
} else {
|
||||
textV.isSingleLine = true
|
||||
textV.textSize = 13.454498F
|
||||
}
|
||||
textV.text =
|
||||
getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + getDoubleHour() + getTime(
|
||||
getYear() + getMonth() + getDay() + getDateSpace() + getWeek() + str + getDoubleHour() + getTime(
|
||||
t
|
||||
) + getSecond()
|
||||
}
|
||||
@@ -209,6 +219,7 @@ class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
} else {
|
||||
doubleHour += " "
|
||||
}
|
||||
|
||||
}
|
||||
return doubleHour
|
||||
}
|
||||
|
||||
@@ -68,5 +68,6 @@
|
||||
<string name="status_bar_time_double_hour">显示时辰</string>
|
||||
<string name="custom_clock_switch">自定义时钟-总开关</string>
|
||||
<string name="status_bar_time_period">显示时段</string>
|
||||
<string name="status_bar_time_double_line">双行显示</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user