diff options
3 files changed, 16 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java index 91a4b07c2109..db3f0d997e08 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java @@ -30,7 +30,6 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.ArrayList; -import java.util.Collection; /** * A global state to track all input states for the algorithm. @@ -72,6 +71,7 @@ public class AmbientState { private ExpandableNotificationRow mExpandingNotification; private int mDarkTopPadding; private float mDarkAmount; + private boolean mAppearing; public AmbientState(Context context) { reload(context); @@ -436,4 +436,12 @@ public class AmbientState { public int getDarkTopPadding() { return mDarkTopPadding; } + + public void setAppearing(boolean appearing) { + mAppearing = appearing; + } + + public boolean isAppearing() { + return mAppearing; + } } 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 bd56d7941a29..a2b33fa1a581 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -885,7 +885,9 @@ public class NotificationStackScrollLayout extends ViewGroup float appearEndPosition = getAppearEndPosition(); float appearStartPosition = getAppearStartPosition(); float appearFraction = 1.0f; - if (height >= appearEndPosition) { + boolean appearing = height < appearEndPosition; + mAmbientState.setAppearing(appearing); + if (!appearing) { translationY = 0; if (mShouldShowShelfOnly) { stackHeight = mTopPadding + mShelf.getIntrinsicHeight(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index 85f33d75e60c..0d50f5a9eef7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -478,22 +478,6 @@ public class StackScrollAlgorithm { childState.hidden = false; } } - // Let's hide all the views if we are not expanded. the views might otherwise be visible - // in the headsup area if a view was swiped away - if (!mIsExpanded) { - for (int i = 0; i < childCount; i++) { - boolean visible = false; - View child = algorithmState.visibleChildren.get(i); - if (child instanceof ExpandableNotificationRow) { - ExpandableNotificationRow row = (ExpandableNotificationRow) child; - visible = row.isHeadsUp() || row.isHeadsUpAnimatingAway(); - } - if (!visible) { - ExpandableViewState childState = resultState.getViewStateForView(child); - childState.hidden = true; - } - } - } } private void clampHunToTop(AmbientState ambientState, ExpandableNotificationRow row, @@ -536,6 +520,10 @@ public class StackScrollAlgorithm { int shelfStart = ambientState.getInnerHeight() - ambientState.getShelf().getIntrinsicHeight(); + if (ambientState.isAppearing() && !child.isAboveShelf()) { + // Don't show none heads-up notifications while in appearing phase. + childViewState.yTranslation = Math.max(childViewState.yTranslation, shelfStart); + } childViewState.yTranslation = Math.min(childViewState.yTranslation, shelfStart); if (childViewState.yTranslation >= shelfStart) { childViewState.hidden = !child.isExpandAnimationRunning() && !child.hasExpandingChild(); |