diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index d378f0de1b7f6..843a99330ab8f 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -57,6 +57,9 @@ 1.0 + + 100dp + 16dp 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 8658111395dee..f27f8f53ad8dc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -189,6 +189,7 @@ public class NotificationPanelView extends PanelView implements private boolean mExpandingFromHeadsUp; private boolean mCollapsedOnDown; private int mPositionMinSideMargin; + private int mMaxFadeoutHeight; private int mLastOrientation = -1; private boolean mClosingWithAlphaFadeOut; private boolean mHeadsUpAnimatingAway; @@ -278,6 +279,8 @@ public class NotificationPanelView extends PanelView implements R.dimen.qs_falsing_threshold); mPositionMinSideMargin = getResources().getDimensionPixelSize( R.dimen.notification_panel_min_side_margin); + mMaxFadeoutHeight = getResources().getDimensionPixelSize( + R.dimen.max_notification_fadeout_height); } public void updateResources() { @@ -552,7 +555,9 @@ public class NotificationPanelView extends PanelView implements protected void flingToHeight(float vel, boolean expand, float target, float collapseSpeedUpFactor, boolean expandBecauseOfFalsing) { mHeadsUpTouchHelper.notifyFling(!expand); - setClosingWithAlphaFadeout(!expand && getFadeoutAlpha() == 1.0f); + setClosingWithAlphaFadeout(!expand + && mNotificationStackScroller.getFirstChildIntrinsicHeight() <= mMaxFadeoutHeight + && getFadeoutAlpha() == 1.0f); super.flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing); } 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 43336a0579fea..cf67732872827 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -701,7 +701,7 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getExpandTranslationStart() { int startPosition = mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp() - ? 0 : -getFirstChildMinHeight(); + ? 0 : -getFirstChildIntrinsicHeight(); return startPosition - mTopPadding; } @@ -2142,17 +2142,17 @@ public class NotificationStackScrollLayout extends ViewGroup } public int getLayoutMinHeight() { - int firstChildMinHeight = getFirstChildMinHeight(); + int firstChildMinHeight = getFirstChildIntrinsicHeight(); return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight, mMaxLayoutHeight - mTopPadding); } - private int getFirstChildMinHeight() { + public int getFirstChildIntrinsicHeight() { final ExpandableView firstChild = getFirstChildNotGone(); int firstChildMinHeight = firstChild != null ? firstChild.getIntrinsicHeight() : mEmptyShadeView != null - ? mEmptyShadeView.getMinHeight() + ? mEmptyShadeView.getIntrinsicHeight() : mCollapsedSize; if (mOwnScrollY > 0) { firstChildMinHeight = Math.max(firstChildMinHeight - mOwnScrollY, mCollapsedSize);