diff options
author | John Spurlock <jspurlock@google.com> | 2015-05-05 09:59:26 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-05-05 10:12:26 -0400 |
commit | 4b43b720544c556e4a8aca4e00a78ea1cd54160f (patch) | |
tree | b0be12dceb77c57b37a0e75c2b297ef20fbedee1 /src/com | |
parent | 0ab13b8326d6f31caff922fd95828254cb95a618 (diff) | |
download | packages_apps_Settings-4b43b720544c556e4a8aca4e00a78ea1cd54160f.zip packages_apps_Settings-4b43b720544c556e4a8aca4e00a78ea1cd54160f.tar.gz packages_apps_Settings-4b43b720544c556e4a8aca4e00a78ea1cd54160f.tar.bz2 |
Settings: Calendar event zen rule string updates.
- Remove Attendance option.
- Use new reply value, tweak wording and summaries.
Bug: 20064962
Change-Id: I6977b494e54752fa87ea08df0ed085129a09a3d3
Diffstat (limited to 'src/com')
3 files changed, 12 insertions, 43 deletions
diff --git a/src/com/android/settings/notification/ZenModeAutomationSettings.java b/src/com/android/settings/notification/ZenModeAutomationSettings.java index e33e32f..9716998 100644 --- a/src/com/android/settings/notification/ZenModeAutomationSettings.java +++ b/src/com/android/settings/notification/ZenModeAutomationSettings.java @@ -202,11 +202,11 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase { } private String computeEventRuleSummary(EventInfo event) { - final String calendar = computeCalendarName(event); - final String attendance = getString(computeAttendance(event)); - final String reply = getString(computeReply(event)); - return getString(R.string.zen_mode_rule_summary_combination, - getString(R.string.zen_mode_rule_summary_combination, calendar, attendance), reply); + final String calendar = getString(R.string.zen_mode_event_rule_summary_calendar_template, + computeCalendarName(event)); + final String reply = getString(R.string.zen_mode_event_rule_summary_reply_template, + getString(computeReply(event))); + return getString(R.string.zen_mode_rule_summary_combination, calendar, reply); } private String computeCalendarName(EventInfo event) { @@ -222,25 +222,16 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase { return getString(R.string.zen_mode_event_rule_summary_any_calendar); } - private int computeAttendance(EventInfo event) { - switch (event.attendance) { - case EventInfo.ATTENDANCE_REQUIRED: - return R.string.zen_mode_event_rule_attendance_required; - case EventInfo.ATTENDANCE_OPTIONAL: - return R.string.zen_mode_event_rule_attendance_optional; - default: - return R.string.zen_mode_event_rule_attendance_required_optional; - } - } - private int computeReply(EventInfo event) { switch (event.reply) { case EventInfo.REPLY_ANY_EXCEPT_NO: - return R.string.zen_mode_event_rule_summary_any_reply_except_no; + return R.string.zen_mode_event_rule_reply_any_except_no; case EventInfo.REPLY_YES: - return R.string.zen_mode_event_rule_summary_replied_yes; + return R.string.zen_mode_event_rule_reply_yes; + case EventInfo.REPLY_YES_OR_MAYBE: + return R.string.zen_mode_event_rule_reply_yes_or_maybe; default: - return R.string.zen_mode_event_rule_summary_any_reply; + throw new IllegalArgumentException("Bad reply: " + event.reply); } } diff --git a/src/com/android/settings/notification/ZenModeEventRuleSettings.java b/src/com/android/settings/notification/ZenModeEventRuleSettings.java index 38581b6..29738b3 100644 --- a/src/com/android/settings/notification/ZenModeEventRuleSettings.java +++ b/src/com/android/settings/notification/ZenModeEventRuleSettings.java @@ -31,13 +31,11 @@ import com.android.settings.R; public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase { private static final String KEY_CALENDAR = "calendar"; - private static final String KEY_ATTENDANCE = "attendance"; private static final String KEY_REPLY = "reply"; public static final String ACTION = Settings.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS; private DropDownPreference mCalendar; - private DropDownPreference mAttendance; private DropDownPreference mReply; private EventInfo mEvent; @@ -92,29 +90,11 @@ public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase { } }); - mAttendance = (DropDownPreference) root.findPreference(KEY_ATTENDANCE); - mAttendance.addItem(R.string.zen_mode_event_rule_attendance_required_optional, - EventInfo.ATTENDANCE_REQUIRED_OR_OPTIONAL); - mAttendance.addItem(R.string.zen_mode_event_rule_attendance_required, - EventInfo.ATTENDANCE_REQUIRED); - mAttendance.addItem(R.string.zen_mode_event_rule_attendance_optional, - EventInfo.ATTENDANCE_OPTIONAL); - mAttendance.setCallback(new DropDownPreference.Callback() { - @Override - public boolean onItemSelected(int pos, Object value) { - final int attendance = (Integer) value; - if (attendance == mEvent.attendance) return true; - mEvent.attendance = attendance; - updateRule(ZenModeConfig.toEventConditionId(mEvent)); - return true; - } - }); - mReply = (DropDownPreference) root.findPreference(KEY_REPLY); - mReply.addItem(R.string.zen_mode_event_rule_reply_any, - EventInfo.REPLY_ANY); mReply.addItem(R.string.zen_mode_event_rule_reply_any_except_no, EventInfo.REPLY_ANY_EXCEPT_NO); + mReply.addItem(R.string.zen_mode_event_rule_reply_yes_or_maybe, + EventInfo.REPLY_YES_OR_MAYBE); mReply.addItem(R.string.zen_mode_event_rule_reply_yes, EventInfo.REPLY_YES); mReply.setCallback(new DropDownPreference.Callback() { @@ -135,7 +115,6 @@ public class ZenModeEventRuleSettings extends ZenModeRuleSettingsBase { @Override protected void updateControlsInternal() { mCalendar.setSelectedValue(mEvent.calendar); - mAttendance.setSelectedValue(mEvent.attendance); mReply.setSelectedValue(mEvent.reply); } diff --git a/src/com/android/settings/notification/ZenRuleNameDialog.java b/src/com/android/settings/notification/ZenRuleNameDialog.java index cd5c766..847007c 100644 --- a/src/com/android/settings/notification/ZenRuleNameDialog.java +++ b/src/com/android/settings/notification/ZenRuleNameDialog.java @@ -166,7 +166,6 @@ public abstract class ZenRuleNameDialog { private static RuleInfo defaultNewEvent() { final EventInfo event = new EventInfo(); event.calendar = 0; // any - event.attendance = EventInfo.ATTENDANCE_REQUIRED_OR_OPTIONAL; event.reply = EventInfo.REPLY_ANY_EXCEPT_NO; final RuleInfo rt = new RuleInfo(); rt.settingsAction = ZenModeEventRuleSettings.ACTION; |