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