summaryrefslogtreecommitdiff
path: root/src/com/android/customization/picker/theme
diff options
context:
space:
mode:
authorchihhangchuang <chihhangchuang@google.com>2020-05-27 01:24:19 +0800
committerchihhangchuang <chihhangchuang@google.com>2020-05-27 01:24:19 +0800
commit962e8ea421aac0d7674cd859635a49920a96d103 (patch)
tree84b588b8d261bcb401cb6bf2d6dfc24b96ab9987 /src/com/android/customization/picker/theme
parent0b5031d8c9c5a22b33ae15e31c1dea8a785f5e3e (diff)
downloadThemePicker-962e8ea421aac0d7674cd859635a49920a96d103.tar.gz
Use the formatted time for preview clock time
Current issue: b/157440597, the AMPM field is available on the preview screen in Mandarin, even we removed it. Screenshot of fixing: lockscreen 12-hour: https://screenshot.googleplex.com/Ub59KfE8nzJ.png lockscreen 24-hour: https://screenshot.googleplex.com/UiPb2Xvtxx2.png theme preview 12-hour: https://screenshot.googleplex.com/uHMovJwu8GG.png theme preview 24-hour: https://screenshot.googleplex.com/Kxwr6Loqy5e.png Test: Manually Fixes: 157440597 Change-Id: I6be7ddb5cb33ae9f5f57f4847728f3d75c5100da
Diffstat (limited to 'src/com/android/customization/picker/theme')
-rw-r--r--src/com/android/customization/picker/theme/ThemeOptionPreviewer.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
index 684ac51a..a3850c6f 100644
--- a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
+++ b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
@@ -46,9 +46,9 @@ import com.android.customization.model.theme.ThemeBundle;
import com.android.customization.model.theme.ThemeBundle.PreviewInfo;
import com.android.wallpaper.R;
import com.android.wallpaper.util.ScreenSizeCalculator;
-import com.android.wallpaper.util.TimeTicker;
+import com.android.wallpaper.util.TimeUtils;
+import com.android.wallpaper.util.TimeUtils.TimeTicker;
-import java.text.FieldPosition;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
@@ -293,13 +293,7 @@ class ThemeOptionPreviewer implements LifecycleObserver {
private void updateTime() {
Calendar calendar = Calendar.getInstance(TimeZone.getDefault());
if (mStatusBarClock != null) {
- StringBuffer time = new StringBuffer();
- FieldPosition amPmPosition = new FieldPosition(java.text.DateFormat.Field.AM_PM);
- DateFormat.getTimeFormat(mContext).format(calendar.getTime(), time, amPmPosition);
- if (amPmPosition.getBeginIndex() > 0) {
- time.delete(amPmPosition.getBeginIndex(), amPmPosition.getEndIndex());
- }
- mStatusBarClock.setText(time);
+ mStatusBarClock.setText(TimeUtils.getFormattedTime(mContext, calendar));
}
if (mSmartSpaceDate != null) {
String datePattern =