Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acd16211 authored by chihhangchuang's avatar chihhangchuang Committed by Automerger Merge Worker
Browse files

Use the formatted time for preview clock time am: 962e8ea4

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/ThemePicker/+/11596393

Change-Id: Id8b0f0ff081582a04aedc625b5c0dc68a090e077
parents bc41eeeb 962e8ea4
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -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 =