Zen: Move zen mode preference to switch bar.

- Add summary line support to SwitchBar.
 - Remove obsolete strings.
 - Wire up switchbar to zen mode w/ dialog prompt.
 - Remove obsolete callback pref helper.

Bug: 20064962
Change-Id: Ifede00b5d43d441ccd94db96bd2796bc57d1a990
This commit is contained in:
John Spurlock
2015-04-04 15:43:37 -04:00
parent c12b1ab221
commit b47b2c3f6a
10 changed files with 219 additions and 159 deletions

View File

@@ -24,6 +24,8 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:maxLines="2"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.Switch"
android:textColor="?android:attr/textColorPrimary"
android:textAlignment="viewStart" />

View File

@@ -5692,20 +5692,17 @@
<!-- Sound & notification > Sound section: Title for the zen mode automation option and associated settings page. [CHAR LIMIT=30] -->
<string name="zen_mode_automation_settings_title">Automatic rules</string>
<!-- Sound & notification > Sound section: Title for the zen mode option. [CHAR LIMIT=60] -->
<string name="zen_mode_option_title">When calls and notifications arrive</string>
<!-- Sound & notification > Sound section: Zen mode option: Off [CHAR LIMIT=60] -->
<string name="zen_mode_option_off">Always interrupt</string>
<!-- Sound & notification > Sound section: Zen mode option: Important interruptions [CHAR LIMIT=60] -->
<string name="zen_mode_option_important_interruptions">Allow only priority interruptions</string>
<string name="zen_mode_option_important_interruptions">Priority only</string>
<!-- Sound & notification > Sound section: Zen mode option: Alarms only [CHAR LIMIT=60] -->
<string name="zen_mode_option_alarms">Allow only alarms</string>
<string name="zen_mode_option_alarms">Alarms only</string>
<!-- Sound & notification > Sound section: Zen mode option: No interruptions [CHAR LIMIT=60] -->
<string name="zen_mode_option_no_interruptions">Don\'t interrupt</string>
<string name="zen_mode_option_no_interruptions">No interruptions</string>
<!-- Sound & notification > Sound section: Zen mode combined summary + condition line [CHAR LIMIT=60] -->
<string name="zen_mode_summary_combination"><xliff:g id="mode" example="Priority only">%1$s</xliff:g> <xliff:g id="exit condition" example="until you turn this off">%2$s</xliff:g></string>
<!-- Sound & notification > Sound section: Title for the option defining the phone ringtone. [CHAR LIMIT=30] -->
<string name="ringtone_title">Phone ringtone</string>
@@ -5875,9 +5872,6 @@
<!-- [CHAR LIMIT=20] Notification settings: App notifications dialog dismiss button caption -->
<string name="app_notifications_dialog_done">Done</string>
<!-- [CHAR LIMIT=30] Zen mode settings: Exit condition selection dialog, default option -->
<string name="zen_mode_default_option">Until you turn this off</string>
<!-- [CHAR LIMIT=60] Zen mode settings: Downtime category text -->
<string name="zen_mode_downtime_category">Downtime</string>

View File

@@ -350,4 +350,8 @@
<item name="android:textColor">@color/fingerprint_message_color</item>
</style>
<style name="TextAppearance.Small.SwitchBar">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">normal</item>
</style>
</resources>

View File

@@ -19,12 +19,6 @@
android:key="zen_mode_settings"
android:title="@string/zen_mode_settings_title" >
<!-- When calls and notifications arrive -->
<com.android.settings.DropDownPreference
android:key="zen_mode"
android:title="@string/zen_mode_option_title"
android:persistent="false" />
<!-- Priority only allows -->
<PreferenceScreen
android:key="priority_settings"