From 32416ca07e7f85a2f6b93bee82accb70a09aea5c Mon Sep 17 00:00:00 2001 From: Luis Vidal Date: Wed, 27 Jul 2016 11:42:45 -0700 Subject: ZenMode rules: Show days list in the correct order Populate the days list based on what the first day of the week is for the current locale. Ex. Sunday is the first item in the list for US, whereas Monday is for UK Change-Id: Ib3c03a59cee73cfcd809fb115a5d49e5eb7c2e45 TICKET: CYNGNOS-3181 --- .../android/settings/notification/ZenModeScheduleDaysSelection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/settings/notification/ZenModeScheduleDaysSelection.java b/src/com/android/settings/notification/ZenModeScheduleDaysSelection.java index 3e88046..a0af03f 100644 --- a/src/com/android/settings/notification/ZenModeScheduleDaysSelection.java +++ b/src/com/android/settings/notification/ZenModeScheduleDaysSelection.java @@ -61,8 +61,9 @@ public class ZenModeScheduleDaysSelection extends ScrollView { } mLayout.setOrientation(LinearLayout.VERTICAL); final Calendar c = Calendar.getInstance(); + int i = c.getFirstDayOfWeek() - 1; final LayoutInflater inflater = LayoutInflater.from(context); - for (int i = 0; i < DAYS.length; i++) { + for (int d = 0; d < DAYS.length; d++) { final int day = DAYS[i]; final CheckBox checkBox = (CheckBox) inflater.inflate(R.layout.zen_schedule_rule_day, this, false); @@ -77,6 +78,7 @@ public class ZenModeScheduleDaysSelection extends ScrollView { } }); mLayout.addView(checkBox); + i = ++i % DAYS.length; } } -- cgit v1.1