diff --git a/res/layout/zen_mode_senders_image.xml b/res/layout/zen_mode_senders_image.xml
index bc7cdae2627..6456b34ac9e 100644
--- a/res/layout/zen_mode_senders_image.xml
+++ b/res/layout/zen_mode_senders_image.xml
@@ -21,5 +21,7 @@
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/zen_senders_image_margin_vertical"
+ android:layout_marginBottom="@dimen/zen_senders_image_margin_vertical"/>
diff --git a/res/layout/zen_mode_senders_overlay_image.xml b/res/layout/zen_mode_senders_overlay_image.xml
index 6976df30d8f..39c1c20db71 100644
--- a/res/layout/zen_mode_senders_overlay_image.xml
+++ b/res/layout/zen_mode_senders_overlay_image.xml
@@ -20,6 +20,8 @@
android:id="@+id/zen_mode_settings_senders_overlay_view"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/zen_conversations_image_margin_vertical"
+ android:layout_marginBottom="@dimen/zen_conversations_image_margin_vertical">
diff --git a/res/layout/zen_mode_settings_button.xml b/res/layout/zen_mode_settings_button.xml
index 72731cc6c2d..291e319c72b 100644
--- a/res/layout/zen_mode_settings_button.xml
+++ b/res/layout/zen_mode_settings_button.xml
@@ -19,37 +19,36 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingVertical="@dimen/zen_mode_button_padding_vertical">
+ android:orientation="vertical">
+ android:layout_marginTop="@dimen/zen_mode_settings_button_margin_vertical"/>
+ android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"/>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index c2539fa9fea..79d797ce94b 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -88,10 +88,15 @@
26dp
48dp
- 16dp
+ 36dp
+ 16dp
+ 24dp
+ 16dp
+ 24dp
+ 32dp
+ 50dp
7dp
17dp
- 56dp
8dp
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f913b7abe64..ec08dc817c1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7958,7 +7958,7 @@
Schedules
- Set duration for Quick Settings
+ Duration for Quick Settings
When Do Not Disturb is on, sound and vibration will be muted, except for the items you allow above.
@@ -8902,7 +8902,7 @@
Calls that can interrupt
- To be sure allowed calls make sound, check whether your device is set to ring, vibrate, or silent.
+ To make sure allowed calls make sound, check that device is set to ring
For \u2018%1$s\u2019 incoming calls are blocked. You can adjust settings to allow your friends, family, or other contacts to reach you.
@@ -8919,11 +8919,11 @@
messages
- SMS, MMS, and messaging apps
+ Messages
Messages that can interrupt
- To be sure allowed messages make sound, check whether your device is set to ring, vibrate, or silent.
+ To make sure allowed messages make sound, check that device is set to ring
For \u2018%1$s\u2019 incoming messages are blocked. You can adjust settings to allow your friends, family, or other contacts to reach you.
@@ -8963,14 +8963,14 @@
Media sounds
- From videos, games, and other media
+ Sounds from videos, games, and other media
media
Touch sounds
- From your keyboard and other buttons
+ Sounds from the keyboard and other buttons
touch sounds
@@ -8982,7 +8982,7 @@
reminders
- Events
+ Calendar events
From upcoming calendar events
@@ -9064,7 +9064,7 @@
%1$s and %2$s
- If the same person calls a second time within a %d minute period
+ If the same person calls a second time within a %d-minute period
Custom
diff --git a/res/xml/zen_mode_settings.xml b/res/xml/zen_mode_settings.xml
index 9649207dbbb..6764e288d43 100644
--- a/res/xml/zen_mode_settings.xml
+++ b/res/xml/zen_mode_settings.xml
@@ -56,7 +56,6 @@
android:key="zen_mode_automation_settings"
android:title="@string/zen_category_schedule"
settings:allowDividerAbove="true"
- settings:allowDividerBelow="true"
android:fragment="com.android.settings.notification.zen.ZenModeAutomationSettings"/>
+ android:title="@string/zen_mode_alarms"/>
+ android:title="@string/zen_mode_reminders"/>
+ android:title="@string/zen_mode_events"/>
-
-
diff --git a/src/com/android/settings/notification/zen/ZenModeBackend.java b/src/com/android/settings/notification/zen/ZenModeBackend.java
index 9291d55a320..b9b27c400f7 100644
--- a/src/com/android/settings/notification/zen/ZenModeBackend.java
+++ b/src/com/android/settings/notification/zen/ZenModeBackend.java
@@ -322,7 +322,7 @@ public class ZenModeBackend {
return R.string.zen_mode_from_starred;
case ZenPolicy.PEOPLE_TYPE_NONE:
default:
- return R.string.zen_mode_from_none_calls;
+ return R.string.zen_mode_from_none;
}
}
@@ -492,8 +492,12 @@ public class ZenModeBackend {
}
String getContactsNumberSummary(Context context) {
+ final int numContacts = queryAllContactsData().getCount();
+ if (numContacts == 0) {
+ return context.getResources().getString(R.string.zen_mode_from_none);
+ }
return context.getResources().getString(R.string.zen_mode_contacts_senders_summary,
- queryAllContactsData().getCount());
+ numContacts);
}
private Cursor queryStarredContactsData() {
diff --git a/src/com/android/settings/notification/zen/ZenModeButtonPreferenceController.java b/src/com/android/settings/notification/zen/ZenModeButtonPreferenceController.java
index 8c1f3ec033c..e97cbba03f7 100644
--- a/src/com/android/settings/notification/zen/ZenModeButtonPreferenceController.java
+++ b/src/com/android/settings/notification/zen/ZenModeButtonPreferenceController.java
@@ -81,10 +81,10 @@ public class ZenModeButtonPreferenceController extends AbstractZenModePreference
});
}
- updateButtons(preference);
+ updatePreference(preference);
}
- private void updateButtons(Preference preference) {
+ private void updatePreference(Preference preference) {
switch (getZenMode()) {
case Settings.Global.ZEN_MODE_ALARMS:
case Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
diff --git a/src/com/android/settings/notification/zen/ZenModeConversationsImagePreferenceController.java b/src/com/android/settings/notification/zen/ZenModeConversationsImagePreferenceController.java
index 2d1f15d07de..78c81341865 100644
--- a/src/com/android/settings/notification/zen/ZenModeConversationsImagePreferenceController.java
+++ b/src/com/android/settings/notification/zen/ZenModeConversationsImagePreferenceController.java
@@ -25,6 +25,7 @@ import android.content.pm.ParceledListSlice;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.service.notification.ConversationChannelWrapper;
+import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -60,7 +61,8 @@ public class ZenModeConversationsImagePreferenceController
mNotificationBackend = notificationBackend;
mIconSizePx =
mContext.getResources().getDimensionPixelSize(R.dimen.zen_conversations_icon_size);
- mIconOffsetPx = mIconSizePx * 3 / 4;
+ mIconOffsetPx = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.zen_conversations_icon_offset);
}
@Override
@@ -97,6 +99,8 @@ public class ZenModeConversationsImagePreferenceController
R.string.zen_mode_from_important_conversations));
} else {
mViewGroup.setContentDescription(null);
+ mViewGroup.setVisibility(View.GONE);
+ return;
}
final int numDrawablesToShow = Math.min(MAX_CONVERSATIONS_SHOWN,
@@ -111,6 +115,8 @@ public class ZenModeConversationsImagePreferenceController
fl.setPadding((numDrawablesToShow - i - 1) * mIconOffsetPx, 0, 0, 0);
mViewGroup.addView(fl);
}
+
+ mViewGroup.setVisibility(numDrawablesToShow > 0 ? View.VISIBLE : View.GONE);
}
private void loadConversations() {
diff --git a/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java b/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java
index 226ce155af3..96ddec2f000 100644
--- a/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java
+++ b/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java
@@ -171,6 +171,10 @@ public class ZenModePrioritySendersPreferenceController
private RadioButtonPreferenceWithExtraWidget makeRadioPreference(String key, int titleId) {
RadioButtonPreferenceWithExtraWidget pref =
new RadioButtonPreferenceWithExtraWidget(mPreferenceCategory.getContext());
+ pref.setKey(key);
+ pref.setTitle(titleId);
+ pref.setOnClickListener(mRadioButtonClickListener);
+
View.OnClickListener widgetClickListener = getWidgetClickListener(key);
if (widgetClickListener != null) {
pref.setExtraWidgetOnClickListener(widgetClickListener);
@@ -179,9 +183,6 @@ public class ZenModePrioritySendersPreferenceController
pref.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_GONE);
}
- pref.setKey(key);
- pref.setTitle(titleId);
- pref.setOnClickListener(mRadioButtonClickListener);
mPreferenceCategory.addPreference(pref);
mRadioButtonPreferences.add(pref);
return pref;
diff --git a/src/com/android/settings/notification/zen/ZenModeSettings.java b/src/com/android/settings/notification/zen/ZenModeSettings.java
index d67c3535e78..7f9a4312c06 100644
--- a/src/com/android/settings/notification/zen/ZenModeSettings.java
+++ b/src/com/android/settings/notification/zen/ZenModeSettings.java
@@ -156,7 +156,7 @@ public class ZenModeSettings extends ZenModeSettingsBase {
|| PRIORITY_CATEGORY_REPEAT_CALLERS == category, true);
int numCategories = enabledCategories.size();
if (numCategories == 0) {
- return mContext.getString(R.string.zen_mode_from_none_calls);
+ return mContext.getString(R.string.zen_mode_from_none);
} else if (numCategories == 1) {
return mContext.getString(R.string.zen_mode_calls_summary_one,
enabledCategories.get(0));
@@ -172,7 +172,7 @@ public class ZenModeSettings extends ZenModeSettingsBase {
category -> PRIORITY_CATEGORY_MESSAGES == category, false);
int numCategories = enabledCategories.size();
if (numCategories == 0) {
- return mContext.getString(R.string.zen_mode_from_none_messages);
+ return mContext.getString(R.string.zen_mode_from_none);
} else {
return enabledCategories.get(0);
}
diff --git a/src/com/android/settings/notification/zen/ZenModeSoundVibrationSettings.java b/src/com/android/settings/notification/zen/ZenModeSoundVibrationSettings.java
index c07ee773c85..61e84fcb2c7 100644
--- a/src/com/android/settings/notification/zen/ZenModeSoundVibrationSettings.java
+++ b/src/com/android/settings/notification/zen/ZenModeSoundVibrationSettings.java
@@ -49,8 +49,6 @@ public class ZenModeSoundVibrationSettings extends ZenModeSettingsBase implement
controllers.add(new ZenModeSystemPreferenceController(context, lifecycle));
controllers.add(new ZenModeRemindersPreferenceController(context, lifecycle));
controllers.add(new ZenModeEventsPreferenceController(context, lifecycle));
- controllers.add(new ZenModeBehaviorFooterPreferenceController(context, lifecycle,
- R.string.zen_sound_footer));
return controllers;
}