diff options
author | John Spurlock <jspurlock@google.com> | 2015-04-30 09:26:15 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-04-30 11:28:27 -0400 |
commit | f57bad7d5b0f9044231fc52351ed27e14013f491 (patch) | |
tree | c2b4e92ca1c90193672919dad665340fe29b3361 /res | |
parent | 0423aed775d0b00cbdf6cc1b422ede704830d43a (diff) | |
download | packages_apps_Settings-f57bad7d5b0f9044231fc52351ed27e14013f491.zip packages_apps_Settings-f57bad7d5b0f9044231fc52351ed27e14013f491.tar.gz packages_apps_Settings-f57bad7d5b0f9044231fc52351ed27e14013f491.tar.bz2 |
Settings: Do not disturb automatic rule updates.
- Remove FAB for adding rules, move to last preference.
- Add first-class event condition type and config sub-page.
- Always show radio buttons when adding rules.
- Add new data model for event rules.
- Add stub condition provider for event rules (always false for now).
- Add rule-type icons to rule preference rows.
Bug: 20064962
Change-Id: Id5acde371eb2e7d22b1f195459897614db5ba80a
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/ic_add.xml | 24 | ||||
-rw-r--r-- | res/drawable/ic_event.xml | 24 | ||||
-rw-r--r-- | res/drawable/ic_label.xml | 24 | ||||
-rw-r--r-- | res/drawable/ic_schedule.xml | 29 | ||||
-rwxr-xr-x | res/layout/zen_rule_name.xml | 11 | ||||
-rw-r--r-- | res/values/strings.xml | 60 | ||||
-rw-r--r-- | res/xml/zen_mode_event_rule_settings.xml | 51 |
7 files changed, 217 insertions, 6 deletions
diff --git a/res/drawable/ic_add.xml b/res/drawable/ic_add.xml new file mode 100644 index 0000000..5939c97 --- /dev/null +++ b/res/drawable/ic_add.xml @@ -0,0 +1,24 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32.0dp" + android:height="32.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> + <path + android:fillColor="?android:attr/colorControlNormal" + android:pathData="M38.0,26.0L26.0,26.0l0.0,12.0l-4.0,0.0L22.0,26.0L10.0,26.0l0.0,-4.0l12.0,0.0L22.0,10.0l4.0,0.0l0.0,12.0l12.0,0.0l0.0,4.0z"/> +</vector> diff --git a/res/drawable/ic_event.xml b/res/drawable/ic_event.xml new file mode 100644 index 0000000..2ca958f --- /dev/null +++ b/res/drawable/ic_event.xml @@ -0,0 +1,24 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32.0dp" + android:height="32.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> + <path + android:fillColor="?android:attr/colorControlNormal" + android:pathData="M34.0,24.0L24.0,24.0l0.0,10.0l10.0,0.0L34.0,24.0zM32.0,2.0l0.0,4.0L16.0,6.0L16.0,2.0l-4.0,0.0l0.0,4.0l-2.0,0.0c-2.21,0.0 -3.98,1.79 -3.98,4.0L6.0,38.0c0.0,2.21 1.79,4.0 4.0,4.0l28.0,0.0c2.21,0.0 4.0,-1.79 4.0,-4.0L42.0,10.0c0.0,-2.21 -1.79,-4.0 -4.0,-4.0l-2.0,0.0L36.0,2.0l-4.0,0.0zm6.0,36.0L10.0,38.0L10.0,16.0l28.0,0.0l0.0,22.0z"/> +</vector> diff --git a/res/drawable/ic_label.xml b/res/drawable/ic_label.xml new file mode 100644 index 0000000..b1ed068 --- /dev/null +++ b/res/drawable/ic_label.xml @@ -0,0 +1,24 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32.0dp" + android:height="32.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> + <path + android:fillColor="?android:attr/colorControlNormal" + android:pathData="M35.27,11.69C34.54,10.67 33.35,10.0 32.0,10.0l-22.0,0.02c-2.21,0.0 -4.0,1.77 -4.0,3.98l0.0,20.0c0.0,2.21 1.79,3.98 4.0,3.98L32.0,38.0c1.35,0.0 2.54,-0.67 3.27,-1.69L44.0,24.0l-8.73,-12.31z"/> +</vector> diff --git a/res/drawable/ic_schedule.xml b/res/drawable/ic_schedule.xml new file mode 100644 index 0000000..c77c50e --- /dev/null +++ b/res/drawable/ic_schedule.xml @@ -0,0 +1,29 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="32.0dp" + android:height="32.0dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> + <path + android:fillColor="?android:attr/colorControlNormal" + android:pathData="M23.99,4.0C12.94,4.0 4.0,12.95 4.0,24.0s8.94,20.0 19.99,20.0C35.04,44.0 44.0,35.05 44.0,24.0S35.04,4.0 23.99,4.0zM24.0,40.0c-8.84,0.0 -16.0,-7.16 -16.0,-16.0S15.16,8.0 24.0,8.0s16.0,7.16 16.0,16.0 -7.16,16.0 -16.0,16.0z" + android:fillAlpha=".9"/> + <path + android:fillColor="?android:attr/colorControlNormal" + android:pathData="M25.0,14.0l-3.0,0.0l0.0,12.0l10.49,6.3L34.0,29.84l-9.0,-5.34z" + android:fillAlpha=".9"/> +</vector> diff --git a/res/layout/zen_rule_name.xml b/res/layout/zen_rule_name.xml index a192c83..b7b0415 100755 --- a/res/layout/zen_rule_name.xml +++ b/res/layout/zen_rule_name.xml @@ -23,6 +23,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" + android:hint="@string/zen_mode_rule_name_hint" android:layout_marginLeft="22dp" android:layout_marginRight="22dp" > @@ -32,7 +33,6 @@ <RadioGroup android:id="@+id/rule_types" - android:visibility="gone" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="22dp" @@ -46,9 +46,10 @@ android:layout_height="wrap_content" android:text="@string/zen_schedule_rule_type_name" /> - <RadioButton android:id="@+id/rule_type_2" + <RadioButton android:id="@+id/rule_type_event" android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" + android:text="@string/zen_event_rule_type_name" /> <RadioButton android:id="@+id/rule_type_3" android:layout_width="match_parent" @@ -58,6 +59,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> + <RadioButton android:id="@+id/rule_type_5" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + </RadioGroup> </LinearLayout> diff --git a/res/values/strings.xml b/res/values/strings.xml index f7d5900..406fc7d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -6059,8 +6059,11 @@ <!-- [CHAR LIMIT=40] Zen mode settings: Rule name option and edit dialog title --> <string name="zen_mode_rule_name">Rule name</string> + <!-- [CHAR LIMIT=40] Zen mode settings: Rule name hint text --> + <string name="zen_mode_rule_name_hint">Enter rule name</string> + <!-- [CHAR LIMIT=40] Zen mode settings: Add rule menu option name --> - <string name="zen_mode_time_add_rule">Add rule</string> + <string name="zen_mode_add_rule">Add rule</string> <!-- [CHAR LIMIT=40] Zen mode settings: Delete rule menu option name --> <string name="zen_mode_delete_rule">Delete rule</string> @@ -6081,7 +6084,58 @@ <string name="zen_mode_configure_rule">Configure rule</string> <!-- [CHAR LIMIT=40] Zen mode settings: Schedule rule type name --> - <string name="zen_schedule_rule_type_name">Schedule rule</string> + <string name="zen_schedule_rule_type_name">Time rule</string> + + <!-- [CHAR LIMIT=NONE] Zen mode settings: Schedule rule toast hint when enabled --> + <string name="zen_schedule_rule_enabled_toast">Automatic rule set to turn on Do Not Disturb during specified times</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event rule type name --> + <string name="zen_event_rule_type_name">Event rule</string> + + <!-- [CHAR LIMIT=NONE] Zen mode settings: Event rule toast hint when enabled --> + <string name="zen_event_rule_enabled_toast">Automatic rule set to turn on Do Not Disturb during specified events</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule calendar option title --> + <string name="zen_mode_event_rule_calendar">Calendar</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule summary fragment: any calendar --> + <string name="zen_mode_event_rule_summary_any_calendar">Any calendar</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule summary fragment: any reply --> + <string name="zen_mode_event_rule_summary_any_reply">Any reply</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule summary fragment: any reply except no --> + <string name="zen_mode_event_rule_summary_any_reply_except_no">Any reply except no</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule summary fragment: replied yes --> + <string name="zen_mode_event_rule_summary_replied_yes">Replied yes</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule calendar option value for any calendar--> + <string name="zen_mode_event_rule_calendar_any">Any</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule attendance option title --> + <string name="zen_mode_event_rule_attendance">Attendance</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule attendance option value: required or optional --> + <string name="zen_mode_event_rule_attendance_required_optional">Required or optional</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule attendance option value: required --> + <string name="zen_mode_event_rule_attendance_required">Required</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule attendance option value: optional --> + <string name="zen_mode_event_rule_attendance_optional">Optional</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule reply option title --> + <string name="zen_mode_event_rule_reply">Reply</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule reply option value: Any --> + <string name="zen_mode_event_rule_reply_any">Any</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule reply option value: Any except no--> + <string name="zen_mode_event_rule_reply_any_except_no">Any except no</string> + + <!-- [CHAR LIMIT=40] Zen mode settings: Event-based rule reply option value: Yes --> + <string name="zen_mode_event_rule_reply_yes">Yes</string> <!-- [CHAR LIMIT=40] Zen mode settings: Text to display if rule isn't found --> <string name="zen_mode_rule_not_found_text">Rule not found.</string> @@ -6089,7 +6143,7 @@ <!-- [CHAR LIMIT=40] Zen mode settings: Rule summary template (when enabled) --> <string name="zen_mode_rule_summary_combination"><xliff:g id="description" example="Sun - Thu">%1$s</xliff:g> / <xliff:g id="mode" example="Alarms only">%2$s</xliff:g></string> - <!-- [CHAR LIMIT=40] Zen mode settings: Timebased rule days option title --> + <!-- [CHAR LIMIT=40] Zen mode settings: Time-based rule days option title --> <string name="zen_mode_schedule_rule_days">Days</string> <!-- [CHAR LIMIT=40] Zen mode settings: Downtime days option value, no days set --> diff --git a/res/xml/zen_mode_event_rule_settings.xml b/res/xml/zen_mode_event_rule_settings.xml new file mode 100644 index 0000000..acad96c --- /dev/null +++ b/res/xml/zen_mode_event_rule_settings.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + android:key="zen_mode_event_rule_settings" > + + <!-- Rule name --> + <Preference + android:key="rule_name" + android:title="@string/zen_mode_rule_name" + android:persistent="false" /> + + <!-- Calendar --> + <com.android.settings.DropDownPreference + android:key="calendar" + android:title="@string/zen_mode_event_rule_calendar" + android:persistent="false" /> + + <!-- Attendance --> + <com.android.settings.DropDownPreference + android:key="attendance" + android:title="@string/zen_mode_event_rule_attendance" + android:persistent="false" /> + + <!-- Reply --> + <com.android.settings.DropDownPreference + android:key="reply" + android:title="@string/zen_mode_event_rule_reply" + android:persistent="false" /> + + <!-- Zen mode --> + <com.android.settings.DropDownPreference + android:key="zen_mode" + android:title="@string/zen_mode_settings_title" + android:persistent="false" /> + +</PreferenceScreen> |