Support daily and hourly battery chartview.
https://drive.google.com/file/d/1vjt6FPFAiFakb158t1IBku1IQNzVPW46/view?usp=sharing&resourcekey=0-f5m2eUKWbth6gdEFh5lOIQ Test: manual Bug: 236101166 Change-Id: I47d899b936742514801cd4fa7a82ddaea5d21c31
This commit is contained in:
@@ -140,7 +140,7 @@ public final class ConvertUtils {
|
||||
|
||||
/** Converts UTC timestamp to local time hour data. */
|
||||
public static String utcToLocalTimeHour(
|
||||
Context context, long timestamp, boolean is24HourFormat) {
|
||||
final Context context, final long timestamp, final boolean is24HourFormat) {
|
||||
final Locale locale = getLocale(context);
|
||||
// e.g. for 12-hour format: 9 pm
|
||||
// e.g. for 24-hour format: 09:00
|
||||
@@ -149,6 +149,13 @@ public final class ConvertUtils {
|
||||
return DateFormat.format(pattern, timestamp).toString().toLowerCase(locale);
|
||||
}
|
||||
|
||||
/** Converts UTC timestamp to local time day of week data. */
|
||||
public static String utcToLocalTimeDayOfWeek(final Context context, final long timestamp) {
|
||||
final Locale locale = getLocale(context);
|
||||
final String pattern = DateFormat.getBestDateTimePattern(locale, "E");
|
||||
return DateFormat.format(pattern, timestamp).toString().toUpperCase(locale);
|
||||
}
|
||||
|
||||
/** Gets indexed battery usage data for each corresponding time slot. */
|
||||
public static Map<Integer, List<BatteryDiffEntry>> getIndexedUsageMap(
|
||||
final Context context,
|
||||
|
||||
Reference in New Issue
Block a user