From 1ba41d1a223a29c36a7d04a035a9c21db2dd5d77 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 21 Apr 2016 16:14:46 -0700 Subject: [PATCH] Fixed a bug where notifications could overlap If the expanded child was smaller then the collapsed one the UI could get very weird. We're now measuring the expanded version at least as big as the collapsed one. Change-Id: Ibb99c4926121b2affcc181071b5e439f23c8e4f2 Fixes: 28318145 Fixes: 28015447 --- .../systemui/statusbar/NotificationContentView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index 83f68e81bca70..7be50c4ecc466 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -177,6 +177,13 @@ public class NotificationContentView extends FrameLayout { if (updateContractedHeaderWidth()) { mContractedChild.measure(widthMeasureSpec, heightSpec); } + if (mExpandedChild != null + && mContractedChild.getMeasuredHeight() > mExpandedChild.getMeasuredHeight()) { + // the Expanded child is smaller then the collapsed. Let's remeasure it. + heightSpec = MeasureSpec.makeMeasureSpec(mContractedChild.getMeasuredHeight(), + MeasureSpec.EXACTLY); + mExpandedChild.measure(widthMeasureSpec, heightSpec); + } } if (mHeadsUpChild != null) { int size = Math.min(maxSize, mHeadsUpHeight);