--- a/packages/SystemUI/res-keyguard/values/donottranslate.xml
+++ b/packages/SystemUI/res-keyguard/values/donottranslate.xml
@@ -22,7 +22,7 @@
<string name="abbrev_wday_month_day_no_year_alarm">EEEMMMd</string>
<!-- Skeleton string format for displaying the time in 12-hour format. -->
- <string name="clock_12hr_format">hm</string>
+ <string name="clock_12hr_format">hma</string>
<!-- Skeleton string format for displaying the time in 24-hour format. -->
<string name="clock_24hr_format">Hm</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index c2c3f81..b18b24f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -122,7 +122,7 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C
R.styleable.Clock,
0, 0);
try {
- mAmPmStyle = a.getInt(R.styleable.Clock_amPmStyle, AM_PM_STYLE_GONE);
+ mAmPmStyle = a.getInt(R.styleable.Clock_amPmStyle, AM_PM_STYLE_NORMAL);
mShowDark = a.getBoolean(R.styleable.Clock_showDark, true);
mNonAdaptedColor = getCurrentTextColor();
} finally {
这篇博客介绍了如何在Android 10系统中更新状态栏和锁屏显示时间,增加了12小时制的AM/PM显示。通过修改`donottranslate.xml`文件的`clock_12hr_format`字符串为`hma`,以及`Clock.java`文件中调整`amPmStyle`属性,使得系统在显示时间时会包含上午下午的标识。
770

被折叠的 条评论
为什么被折叠?



