Fixed the divider height to be at least 1px high
Also adapted the children divider to be consistent
Change-Id: I158167f70e9e0bc9e251785078a4b271720919c5
diff --git a/packages/SystemUI/res/layout/notification_children_divider.xml b/packages/SystemUI/res/layout/notification_children_divider.xml
index 53273cf..dad7cea 100644
--- a/packages/SystemUI/res/layout/notification_children_divider.xml
+++ b/packages/SystemUI/res/layout/notification_children_divider.xml
@@ -19,5 +19,5 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notification_more_divider"
android:layout_width="match_parent"
- android:layout_height="@dimen/notification_children_divider_height"
+ android:layout_height="@dimen/notification_divider_height"
android:background="#61000000" />
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 5c52eb6..54f5c88 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -87,9 +87,6 @@
<!-- gap on either side of status bar notification icons -->
<dimen name="status_bar_icon_padding">0dp</dimen>
- <!-- half the distance between notifications in the panel -->
- <dimen name="notification_divider_height">2dp</dimen>
-
<!-- The padding on the global screenshot background image -->
<dimen name="global_screenshot_bg_padding">20dp</dimen>
@@ -301,8 +298,8 @@
<!-- Z distance between notifications if they are in the stack -->
<dimen name="z_distance_between_notifications">1dp</dimen>
- <!-- The padding between the individual notification cards. -->
- <dimen name="notification_padding">0.5dp</dimen>
+ <!-- The height of the divider between the individual notifications. -->
+ <dimen name="notification_divider_height">0.5dp</dimen>
<!-- The minimum amount of top overscroll to go to the quick settings. -->
<dimen name="min_top_overscroll_to_qs">36dp</dimen>
@@ -372,9 +369,6 @@
<!-- The padding on top of the first notification to the children container -->
<dimen name="notification_children_container_top_padding">8dp</dimen>
- <!-- The height of the divider between the notfication children -->
- <dimen name="notification_children_divider_height">1dp</dimen>
-
<!-- The vertical distance from which the notification appear when children are expanded -->
<dimen name="notification_appear_distance">140dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 50dd959..8e89efd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -422,8 +422,8 @@
public int computeMaxKeyguardNotifications(int maximum) {
float minPadding = mClockPositionAlgorithm.getMinStackScrollerPadding(getHeight(),
mKeyguardStatusView.getHeight());
- int notificationPadding = getResources().getDimensionPixelSize(
- R.dimen.notification_padding);
+ int notificationPadding = Math.max(1, getResources().getDimensionPixelSize(
+ R.dimen.notification_divider_height));
final int overflowheight = getResources().getDimensionPixelSize(
R.dimen.notification_summary_height);
float bottomStackSize = mNotificationStackScroller.getKeyguardBottomStackSize();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
index ac1e06c..482c366 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java
@@ -76,8 +76,8 @@
super(context, attrs, defStyleAttr, defStyleRes);
mChildPadding = getResources().getDimensionPixelSize(
R.dimen.notification_children_padding);
- mDividerHeight = getResources().getDimensionPixelSize(
- R.dimen.notification_children_divider_height);
+ mDividerHeight = Math.max(1, getResources().getDimensionPixelSize(
+ R.dimen.notification_divider_height));
mMaxNotificationHeight = getResources().getDimensionPixelSize(
R.dimen.notification_max_height);
mNotificationAppearDistance = getResources().getDimensionPixelSize(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 6bc49ff..1fbf19a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -367,8 +367,8 @@
mBottomStackPeekSize = context.getResources()
.getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
mStackScrollAlgorithm.initView(context);
- mPaddingBetweenElementsNormal = context.getResources()
- .getDimensionPixelSize(R.dimen.notification_padding);
+ mPaddingBetweenElementsNormal = Math.max(1, context.getResources()
+ .getDimensionPixelSize(R.dimen.notification_divider_height));
mPaddingBetweenElements = mPaddingBetweenElementsNormal;
mBottomStackSlowDownHeight = mStackScrollAlgorithm.getBottomStackSlowDownLength();
mMinTopOverScrollToEscape = getResources().getDimensionPixelSize(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
index c1eb1a8..523b8e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
@@ -17,7 +17,6 @@
package com.android.systemui.statusbar.stack;
import android.content.Context;
-import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@@ -95,8 +94,8 @@
}
private void initConstants(Context context) {
- mPaddingBetweenElementsNormal = context.getResources()
- .getDimensionPixelSize(R.dimen.notification_padding);
+ mPaddingBetweenElementsNormal = Math.max(1, context.getResources()
+ .getDimensionPixelSize(R.dimen.notification_divider_height));
mCollapsedSize = context.getResources()
.getDimensionPixelSize(R.dimen.notification_min_height);
mTopStackPeekSize = context.getResources()