Heads-up notifications now reuse the views from the shade
Change-Id: I6f43b70022f1ea439b80f6b6a0279a03d8c75887
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
index ebc663c..2d96199 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
@@ -33,9 +33,9 @@
*/
public abstract class ExpandableView extends FrameLayout {
- private final int mMaxNotificationHeight;
private OnHeightChangedListener mOnHeightChangedListener;
+ protected int mMaxViewHeight;
private int mActualHeight;
protected int mClipTopAmount;
private boolean mActualHeightInitialized;
@@ -44,13 +44,13 @@
public ExpandableView(Context context, AttributeSet attrs) {
super(context, attrs);
- mMaxNotificationHeight = getResources().getDimensionPixelSize(
+ mMaxViewHeight = getResources().getDimensionPixelSize(
R.dimen.notification_max_height);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int ownMaxHeight = mMaxNotificationHeight;
+ int ownMaxHeight = mMaxViewHeight;
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
@@ -81,7 +81,8 @@
mMatchParentViews.add(child);
}
}
- int ownHeight = hasFixedHeight ? ownMaxHeight : maxChildHeight;
+ int ownHeight = hasFixedHeight ? ownMaxHeight :
+ isHeightLimited ? Math.min(ownMaxHeight, maxChildHeight) : maxChildHeight;
newHeightSpec = MeasureSpec.makeMeasureSpec(ownHeight, MeasureSpec.EXACTLY);
for (View child : mMatchParentViews) {
child.measure(getChildMeasureSpec(