Merge "Correct night light qs tile time formatting." into pi-dev
am: 6567c65fa1
Change-Id: I1cd8d676e5e77317badac997661db5b5a1a48ee5
This commit is contained in:
committed by
android-build-merger
commit
aa0d1fefe3
@@ -45,8 +45,8 @@ public class NightDisplayTile extends QSTileImpl<BooleanState>
|
||||
* Pattern for {@link java.time.format.DateTimeFormatter} used to approximate the time to the
|
||||
* nearest hour and add on the AM/PM indicator.
|
||||
*/
|
||||
private static final String HOUR_MINUTE_DATE_TIME_PATTERN = "h a";
|
||||
private static final String APPROXIMATE_HOUR_DATE_TIME_PATTERN = "h:m a";
|
||||
private static final String PATTERN_HOUR = "h a";
|
||||
private static final String PATTERN_HOUR_MINUTE = "h:mm a";
|
||||
|
||||
|
||||
private ColorDisplayController mController;
|
||||
@@ -142,9 +142,7 @@ public class NightDisplayTile extends QSTileImpl<BooleanState>
|
||||
// Choose between just showing the hour or also showing the minutes (based on the
|
||||
// user-selected toggle time). This helps reduce how much space the label takes.
|
||||
toggleTimeFormat = DateTimeFormatter.ofPattern(
|
||||
toggleTime.getMinute() == 0
|
||||
? HOUR_MINUTE_DATE_TIME_PATTERN
|
||||
: APPROXIMATE_HOUR_DATE_TIME_PATTERN);
|
||||
toggleTime.getMinute() == 0 ? PATTERN_HOUR : PATTERN_HOUR_MINUTE);
|
||||
|
||||
return mContext.getString(toggleTimeStringRes, toggleTime.format(toggleTimeFormat));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user