From 98be3f375b9109e821631df03785cdcd9a3fa104 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 17 Dec 2015 16:39:06 -0800 Subject: Fixed that the expandButton was sometimes visible when it shouldnt This happened when the collapsed height had the same height as the expanded one. Bug: 26185377 Change-Id: I9c37a8239cc87bf2192f48bc008700faf4afb5d9 --- packages/SystemUI/res/values/dimens.xml | 2 +- .../android/systemui/statusbar/NotificationContentView.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 3797644ca7f4..24cc6bf1589a 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -49,7 +49,7 @@ 128dp - 140dp + 141dp 44dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index ca68856b34e6..02a39e79b700 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -107,6 +107,8 @@ public class NotificationContentView extends FrameLayout { }; private OnClickListener mExpandClickListener; private boolean mBeforeN; + private boolean mExpandable; + public NotificationContentView(Context context, AttributeSet attrs) { super(context, attrs); mHybridViewManager = new HybridNotificationViewManager(getContext(), this); @@ -491,6 +493,7 @@ public class NotificationContentView extends FrameLayout { public void setHeadsUp(boolean headsUp) { mIsHeadsUp = headsUp; selectLayout(false /* animate */, true /* force */); + updateExpandButtons(mExpandable); } @Override @@ -610,6 +613,13 @@ public class NotificationContentView extends FrameLayout { } public void updateExpandButtons(boolean expandable) { + mExpandable = expandable; + // if the expanded child has the same height as the collapsed one we hide it. + if (mExpandedChild != null && mExpandedChild.getHeight() != 0 && + ((mIsHeadsUp && mExpandedChild.getHeight() == mHeadsUpChild.getHeight()) || + (!mIsHeadsUp && mExpandedChild.getHeight() == mContractedChild.getHeight()))) { + expandable = false; + } if (mExpandedChild != null) { mExpandedWrapper.updateExpandability(expandable, mExpandClickListener); } -- cgit v1.2.3-59-g8ed1b