From def35a86530200958384191d43d321dbcda16e2a Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 3 May 2016 15:52:51 -0700 Subject: Fixed a bug where the content height was wrong when dragging down from a HUN the content height was wrong. Change-Id: Ic30e4de67625ed88942c71e68e6009b832d064ed Fixes: 28563238 --- .../src/com/android/systemui/statusbar/ExpandableNotificationRow.java | 4 ++++ .../src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java | 4 +++- .../SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index b25adc3f2cfc..1a34dd79d63a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -455,7 +455,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { * @param pinned whether it is pinned */ public void setPinned(boolean pinned) { + int intrinsicHeight = getIntrinsicHeight(); mIsPinned = pinned; + if (intrinsicHeight != getIntrinsicHeight()) { + notifyHeightChanged(false); + } if (pinned) { setIconAnimationRunning(true); mExpandedWhenPinned = false; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java index 33315c58fb4a..bd59fb03d59a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java @@ -103,10 +103,12 @@ public class HeadsUpTouchHelper implements Gefingerpoken { mInitialTouchX = x; mInitialTouchY = y; int expandedHeight = mPickedChild.getActualHeight(); - mHeadsUpManager.unpinAll(); mPanel.setPanelScrimMinFraction((float) expandedHeight / mPanel.getMaxPanelHeight()); mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight); + // This call needs to be after the expansion start otherwise we will get a + // flicker of one frame as it's not expanded yet. + mHeadsUpManager.unpinAll(); mPanel.clearNotificationEffects(); return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 7c70e22c5302..e4aa10361e87 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -362,6 +362,7 @@ public abstract class PanelView extends FrameLayout { mInitialTouchX = newX; if (startTracking) { mTouchSlopExceeded = true; + setExpandedHeight(mInitialOffsetOnTouch); onTrackingStarted(); } } -- cgit v1.2.3-59-g8ed1b