App & channel notification settings updates

- change 'block all' to an on/off switch bar
- update channel list summary text when notifications are
toggled on/off on app settings page
- Add 'off state' text
- change style of foot items
- change 'importance' from a dropdown to its own page

Bug: 37538972
Bug: 37479730
Fixes: 37541624
Fixes: 37549732
Test: manual

Change-Id: I0e5cc66ba539ce2b76b4ad6541bf6bfb5b58c373
This commit is contained in:
Julia Reynolds
2017-04-21 08:27:06 -04:00
parent 8da8951b4b
commit 38c16a9417
12 changed files with 489 additions and 140 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<!-- For use in a LayoutPreference -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="0px"
android:layout_width="match_parent"
android:layout_weight="1" >
<com.android.settings.widget.SwitchBar
android:id="@+id/switch_bar"
android:layout_height="?android:attr/actionBarSize"
android:layout_width="match_parent"
android:paddingStart="0dp"
android:background="@drawable/switchbar_background"
android:theme="?attr/switchBarTheme"
/>
</LinearLayout>

View File

@@ -6558,7 +6558,10 @@
<!-- Notification Settings: Title for the option managing notifications per application. [CHAR LIMIT=30] -->
<string name="app_notifications_title">Notifications</string>
<!-- [CHAR LIMIT=100] Notification importance slider title -->
<!-- [CHAR LIMIT=100] Notification channel title -->
<string name="notification_channel_title">Notification category</string>
<!-- [CHAR LIMIT=100] Notification importance screen title -->
<string name="notification_importance_title">Importance</string>
<!-- [CHAR LIMIT=100] Notification Importance: unspecified importance level description -->
@@ -6579,17 +6582,17 @@
<!-- [CHAR LIMIT=100] Notification Importance: high importance level description -->
<string name="notification_importance_high">Make sound and pop on screen</string>
<!-- [CHAR LIMIT=100] Notification Importance summary: min importance level description -->
<string name="notification_importance_min_summary">Low: No sound or visual interruption</string>
<!-- [CHAR LIMIT=100] Notification Importance title: min importance level title -->
<string name="notification_importance_min_title">Low</string>
<!-- [CHAR LIMIT=100] Notification Importance summary: low importance level description -->
<string name="notification_importance_low_summary">Medium: No sound</string>
<!-- [CHAR LIMIT=100] Notification Importance title: low importance level title -->
<string name="notification_importance_low_title">Medium</string>
<!-- [CHAR LIMIT=100] Notification Importance summary: normal importance level description -->
<string name="notification_importance_default_summary">High: Make sound</string>
<!-- [CHAR LIMIT=100] Notification Importance title: normal importance level title -->
<string name="notification_importance_default_title">High</string>
<!-- [CHAR LIMIT=100] Notification Importance summary: high importance level description -->
<string name="notification_importance_high_summary">Urgent: Make sound and pop on screen</string>
<!-- [CHAR LIMIT=100] Notification Importance title: high importance level title -->
<string name="notification_importance_high_title">Urgent</string>
<!-- [CHAR LIMIT=40] Notification importance title -->
<string name="allow_sound">Allow Sound</string>
@@ -6694,6 +6697,12 @@
<!-- [CHAR LIMIT=NONE] Text when loading app list in notification settings -->
<string name="loading_notification_apps">Loading apps...</string>
<!-- [CHAR LIMIT=NONE] Text appearing when app notifications are off -->
<string name="app_notifications_off_desc">Android is blocking this app\'s notifications from appearing on this device</string>
<!-- [CHAR LIMIT=NONE] Text appearing when channel notifications are off -->
<string name="channel_notifications_off_desc">Android is blocking this category of notifications from appearing on this device</string>
<!-- [CHAR LIMIT=NONE] App notification settings: channels title -->
<string name="notification_channels">Categories</string>

View File

@@ -18,13 +18,6 @@
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/app_notifications_title"
android:key="app_notification_settings">
<!-- Block -->
<com.android.settingslib.RestrictedSwitchPreference
android:key="block"
android:title="@string/app_notification_block_title"
android:summary="@string/app_notification_block_summary"
settings:useAdditionalSummary="true"
settings:restrictedSwitchSummary="@string/enabled_by_admin" />
<!-- Show badge -->
<com.android.settingslib.RestrictedSwitchPreference

View File

@@ -18,16 +18,7 @@
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" >
<!-- Importance -->
<!-- Block -->
<com.android.settingslib.RestrictedSwitchPreference
android:key="block"
android:title="@string/app_notification_block_title"
android:summary="@string/app_notification_block_summary"
settings:useAdditionalSummary="true"
settings:restrictedSwitchSummary="@string/enabled_by_admin" />
<!-- Importance -->
<com.android.settings.notification.RestrictedDropDownPreference
<Preference
android:key="importance"
android:title="@string/notification_importance_title" />

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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:title="@string/notification_importance_title">
<com.android.settings.widget.RadioButtonPreference
android:key="importance_high"
android:title="@string/notification_importance_high_title"
android:summary="@string/notification_importance_high"
/>
<com.android.settings.widget.RadioButtonPreference
android:key="importance_default"
android:title="@string/notification_importance_default_title"
android:summary="@string/notification_importance_default" />
<com.android.settings.widget.RadioButtonPreference
android:key="importance_low"
android:title="@string/notification_importance_low_title"
android:summary="@string/notification_importance_low" />
<com.android.settings.widget.RadioButtonPreference
android:key="importance_min"
android:title="@string/notification_importance_min_title"
android:summary="@string/notification_importance_min" />
</PreferenceScreen>