diff options
author | Barnaby James <bjames@google.com> | 2015-04-15 15:43:30 -0700 |
---|---|---|
committer | Barnaby James <bjames@google.com> | 2015-04-16 07:20:13 -0700 |
commit | f79e2d11f5ada36705bef1deb58f0f42504ef327 (patch) | |
tree | 5cac5a4ea296a7c0aa8cdd69cc6deb82ea733c33 /src/com/android/settings/notification/ZenModeVoiceActivity.java | |
parent | b8e02b8bd003fdcd5e680c7a6b37e1797ec12cc9 (diff) | |
download | packages_apps_Settings-f79e2d11f5ada36705bef1deb58f0f42504ef327.zip packages_apps_Settings-f79e2d11f5ada36705bef1deb58f0f42504ef327.tar.gz packages_apps_Settings-f79e2d11f5ada36705bef1deb58f0f42504ef327.tar.bz2 |
UI Tweaks to Zen Mode Voice Activity.
Small cleanup of the UI / strings.
- Cleanup of string constant names.
- Add a specific string for ZenModeVoiceActivity label.
- Change look of list position indicators.
- Add optional header to VoiceSettingsActivity.
- Fix NPE in some cases when disabling Zen mode.
Change-Id: Ic09ee2b1b5a50891b5447c2db0e3de3c475696bf
Diffstat (limited to 'src/com/android/settings/notification/ZenModeVoiceActivity.java')
-rw-r--r-- | src/com/android/settings/notification/ZenModeVoiceActivity.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/com/android/settings/notification/ZenModeVoiceActivity.java b/src/com/android/settings/notification/ZenModeVoiceActivity.java index c7c1151..2994ed1 100644 --- a/src/com/android/settings/notification/ZenModeVoiceActivity.java +++ b/src/com/android/settings/notification/ZenModeVoiceActivity.java @@ -65,22 +65,24 @@ public class ZenModeVoiceActivity extends VoiceSettingsActivity { boolean enabled = intent.getBooleanExtra(EXTRA_DO_NOT_DISTURB_MODE_ENABLED, false); boolean specified = intent.hasExtra(EXTRA_DO_NOT_DISTURB_MODE_ENABLED); + setHeader(getString(R.string.zen_mode_interruptions_voice_header)); + List<VoiceSelection> states = new ArrayList<VoiceSelection>(); if (!specified || enabled) { states.add(new ModeSelection(this, Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, - R.string.zen_mode_option_important_interruptions, - R.string.zen_mode_option_important_voice_synonyms)); + R.string.zen_mode_option_voice_important_interruptions, + R.string.zen_mode_option_voice_important_synonyms)); states.add(new ModeSelection(this, Global.ZEN_MODE_ALARMS, - R.string.zen_mode_option_alarms, - R.string.zen_mode_option_alarms_voice_synonyms)); + R.string.zen_mode_option_voice_alarms, + R.string.zen_mode_option_voice_alarms_synonyms)); states.add(new ModeSelection(this, Global.ZEN_MODE_NO_INTERRUPTIONS, - R.string.zen_mode_option_no_interruptions, - R.string.zen_mode_option_no_interruptions_voice_synonyms)); + R.string.zen_mode_option_voice_no_interruptions, + R.string.zen_mode_option_voice_no_interruptions_synonyms)); } if (!specified || !enabled) { states.add(new ModeSelection(this, Global.ZEN_MODE_OFF, - R.string.zen_mode_option_off, - R.string.zen_mode_option_off_voice_synonyms)); + R.string.zen_mode_option_voice_all_interruptions, + R.string.zen_mode_option_voice_all_interruptions_synonyms)); } VoiceSelectionFragment fragment = new VoiceSelectionFragment(); fragment.setArguments(VoiceSelectionFragment.createArguments( @@ -98,8 +100,10 @@ public class ZenModeVoiceActivity extends VoiceSettingsActivity { pickDuration(selection.getLabel(), mode); return; } + setZenModeConfig(mode, conditionSelection.mCondition); + } else { + setZenModeConfig(Global.ZEN_MODE_OFF, null); } - setZenModeConfig(mode, conditionSelection.mCondition); notifySuccess(getChangeSummary(mode, conditionSelection)); finish(); } @@ -112,6 +116,8 @@ public class ZenModeVoiceActivity extends VoiceSettingsActivity { */ private void pickDuration(CharSequence label, final int mode) { setTitle(label.toString()); + setHeader(null); + List<VoiceSelection> states = new ArrayList<VoiceSelection>(); states.add(new ConditionSelection(null, -1, getString(R.string.zen_mode_duration_indefinte_voice_label), @@ -137,13 +143,6 @@ public class ZenModeVoiceActivity extends VoiceSettingsActivity { showFragment(fragment, "pick_duration_fragment"); } - private void showFragment(Fragment fragment, String tag) { - getFragmentManager() - .beginTransaction() - .replace(R.id.fragment_root, fragment, tag) - .commit(); - } - private void setZenModeConfig(int mode, Condition condition) { if (condition != null) { NotificationManager.from(this).setZenMode(mode, condition.id, TAG); |