Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +9 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private int mNotificationMaxHeight; private int mNotificationAmbientHeight; private int mIncreasedPaddingBetweenElements; private boolean mMustStayOnScreen; /** Does this row contain layouts that can adapt to row expansion */ private boolean mExpandable; Loading Loading @@ -491,6 +492,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView notifyHeightChanged(false /* needsAnimation */); } if (isHeadsUp) { mMustStayOnScreen = true; setAboveShelf(true); } else if (isAboveShelf() != wasAboveShelf) { mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf); Loading @@ -517,6 +519,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView addChildNotification(row, -1); } @Override public void setHeadsUpIsVisible() { super.setHeadsUpIsVisible(); mMustStayOnScreen = false; } /** * Add a child notification to this view. * Loading Loading @@ -1942,7 +1950,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public boolean mustStayOnScreen() { return mIsHeadsUp; return mIsHeadsUp && mMustStayOnScreen; } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +3 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,9 @@ public abstract class ExpandableView extends FrameLayout { return false; } public void setHeadsUpIsVisible() { } public boolean isChildInGroup() { return false; } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/ExpandableViewState.java +15 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,12 @@ public class ExpandableViewState extends ViewState { public float shadowAlpha; public boolean inShelf; /** * A state indicating whether a headsup is currently fully visible, even when not scrolled. * Only valid if the view is heads upped. */ public boolean headsUpIsVisible; /** * How much the child overlaps with the previous child on top. This is used to * show the background properly when the child on top is translating away. Loading Loading @@ -126,6 +132,7 @@ public class ExpandableViewState extends ViewState { clipTopAmount = svs.clipTopAmount; notGoneIndex = svs.notGoneIndex; location = svs.location; headsUpIsVisible = svs.headsUpIsVisible; } } Loading Loading @@ -175,6 +182,10 @@ public class ExpandableViewState extends ViewState { expandableView.setTransformingInShelf(false); expandableView.setInShelf(inShelf); if (headsUpIsVisible) { expandableView.setHeadsUpIsVisible(); } } } Loading Loading @@ -229,6 +240,10 @@ public class ExpandableViewState extends ViewState { expandableView.setTransformingInShelf(true); } expandableView.setInShelf(this.inShelf); if (headsUpIsVisible) { expandableView.setHeadsUpIsVisible(); } } private void startHeightAnimation(final ExpandableView child, AnimationProperties properties) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -624,7 +624,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (childViewState == null) { return false; } if ((childViewState.location &= ExpandableViewState.VISIBLE_LOCATIONS) == 0) { if ((childViewState.location & ExpandableViewState.VISIBLE_LOCATIONS) == 0) { return false; } if (row.getVisibility() != View.VISIBLE) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +21 −11 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ public class StackScrollAlgorithm { for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState state = resultState.getViewStateForView(child); if (!child.mustStayOnScreen()) { if (!child.mustStayOnScreen() || state.headsUpIsVisible) { previousNotificationEnd = Math.max(drawStart, previousNotificationEnd); previousNotificationStart = Math.max(drawStart, previousNotificationStart); } Loading Loading @@ -378,6 +378,13 @@ public class StackScrollAlgorithm { boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; float inset = ambientState.getTopPadding() + ambientState.getStackTranslation(); if (child.mustStayOnScreen() && childViewState.yTranslation >= 0) { // Even if we're not scrolled away we're in view and we're also not in the // shelf. We can relax the constraints and let us scroll off the top! float end = childViewState.yTranslation + childViewState.height + inset; childViewState.headsUpIsVisible = end < ambientState.getMaxHeadsUpTranslation(); } if (isDismissView) { childViewState.yTranslation = Math.min(childViewState.yTranslation, ambientState.getInnerHeight() - childHeight); Loading @@ -396,8 +403,7 @@ public class StackScrollAlgorithm { Log.wtf(LOG_TAG, "Failed to assign location for child " + i); } childViewState.yTranslation += ambientState.getTopPadding() + ambientState.getStackTranslation(); childViewState.yTranslation += inset; return currentYPosition; } Loading @@ -420,13 +426,14 @@ public class StackScrollAlgorithm { break; } ExpandableViewState childState = resultState.getViewStateForView(row); if (topHeadsUpEntry == null) { if (topHeadsUpEntry == null && row.mustStayOnScreen() && !childState.headsUpIsVisible) { topHeadsUpEntry = row; childState.location = ExpandableViewState.LOCATION_FIRST_HUN; } boolean isTopEntry = topHeadsUpEntry == row; float unmodifiedEndLocation = childState.yTranslation + childState.height; if (mIsExpanded) { if (row.mustStayOnScreen() && !childState.headsUpIsVisible) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0 && ambientState.isAboveShelf(row)) { Loading @@ -435,6 +442,7 @@ public class StackScrollAlgorithm { childState.hidden = false; } } } if (row.isPinned()) { childState.yTranslation = Math.max(childState.yTranslation, 0); childState.height = Math.max(row.getIntrinsicHeight(), childState.height); Loading Loading @@ -493,6 +501,7 @@ public class StackScrollAlgorithm { if (childViewState.yTranslation >= shelfStart) { childViewState.hidden = true; childViewState.inShelf = true; childViewState.headsUpIsVisible = false; } if (!ambientState.isShadeExpanded()) { childViewState.height = (int) (mStatusBarHeight - childViewState.yTranslation); Loading Loading @@ -531,7 +540,8 @@ public class StackScrollAlgorithm { ExpandableViewState childViewState = resultState.getViewStateForView(child); int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements(); float baseZ = ambientState.getBaseZHeight(); if (child.mustStayOnScreen() && !ambientState.isDozingAndNotPulsing(child) if (child.mustStayOnScreen() && !childViewState.headsUpIsVisible && !ambientState.isDozingAndNotPulsing(child) && childViewState.yTranslation < ambientState.getTopPadding() + ambientState.getStackTranslation()) { if (childrenOnTop != 0.0f) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +9 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private int mNotificationMaxHeight; private int mNotificationAmbientHeight; private int mIncreasedPaddingBetweenElements; private boolean mMustStayOnScreen; /** Does this row contain layouts that can adapt to row expansion */ private boolean mExpandable; Loading Loading @@ -491,6 +492,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView notifyHeightChanged(false /* needsAnimation */); } if (isHeadsUp) { mMustStayOnScreen = true; setAboveShelf(true); } else if (isAboveShelf() != wasAboveShelf) { mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf); Loading @@ -517,6 +519,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView addChildNotification(row, -1); } @Override public void setHeadsUpIsVisible() { super.setHeadsUpIsVisible(); mMustStayOnScreen = false; } /** * Add a child notification to this view. * Loading Loading @@ -1942,7 +1950,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public boolean mustStayOnScreen() { return mIsHeadsUp; return mIsHeadsUp && mMustStayOnScreen; } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +3 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,9 @@ public abstract class ExpandableView extends FrameLayout { return false; } public void setHeadsUpIsVisible() { } public boolean isChildInGroup() { return false; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/ExpandableViewState.java +15 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,12 @@ public class ExpandableViewState extends ViewState { public float shadowAlpha; public boolean inShelf; /** * A state indicating whether a headsup is currently fully visible, even when not scrolled. * Only valid if the view is heads upped. */ public boolean headsUpIsVisible; /** * How much the child overlaps with the previous child on top. This is used to * show the background properly when the child on top is translating away. Loading Loading @@ -126,6 +132,7 @@ public class ExpandableViewState extends ViewState { clipTopAmount = svs.clipTopAmount; notGoneIndex = svs.notGoneIndex; location = svs.location; headsUpIsVisible = svs.headsUpIsVisible; } } Loading Loading @@ -175,6 +182,10 @@ public class ExpandableViewState extends ViewState { expandableView.setTransformingInShelf(false); expandableView.setInShelf(inShelf); if (headsUpIsVisible) { expandableView.setHeadsUpIsVisible(); } } } Loading Loading @@ -229,6 +240,10 @@ public class ExpandableViewState extends ViewState { expandableView.setTransformingInShelf(true); } expandableView.setInShelf(this.inShelf); if (headsUpIsVisible) { expandableView.setHeadsUpIsVisible(); } } private void startHeightAnimation(final ExpandableView child, AnimationProperties properties) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -624,7 +624,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (childViewState == null) { return false; } if ((childViewState.location &= ExpandableViewState.VISIBLE_LOCATIONS) == 0) { if ((childViewState.location & ExpandableViewState.VISIBLE_LOCATIONS) == 0) { return false; } if (row.getVisibility() != View.VISIBLE) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +21 −11 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ public class StackScrollAlgorithm { for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState state = resultState.getViewStateForView(child); if (!child.mustStayOnScreen()) { if (!child.mustStayOnScreen() || state.headsUpIsVisible) { previousNotificationEnd = Math.max(drawStart, previousNotificationEnd); previousNotificationStart = Math.max(drawStart, previousNotificationStart); } Loading Loading @@ -378,6 +378,13 @@ public class StackScrollAlgorithm { boolean isEmptyShadeView = child instanceof EmptyShadeView; childViewState.location = ExpandableViewState.LOCATION_MAIN_AREA; float inset = ambientState.getTopPadding() + ambientState.getStackTranslation(); if (child.mustStayOnScreen() && childViewState.yTranslation >= 0) { // Even if we're not scrolled away we're in view and we're also not in the // shelf. We can relax the constraints and let us scroll off the top! float end = childViewState.yTranslation + childViewState.height + inset; childViewState.headsUpIsVisible = end < ambientState.getMaxHeadsUpTranslation(); } if (isDismissView) { childViewState.yTranslation = Math.min(childViewState.yTranslation, ambientState.getInnerHeight() - childHeight); Loading @@ -396,8 +403,7 @@ public class StackScrollAlgorithm { Log.wtf(LOG_TAG, "Failed to assign location for child " + i); } childViewState.yTranslation += ambientState.getTopPadding() + ambientState.getStackTranslation(); childViewState.yTranslation += inset; return currentYPosition; } Loading @@ -420,13 +426,14 @@ public class StackScrollAlgorithm { break; } ExpandableViewState childState = resultState.getViewStateForView(row); if (topHeadsUpEntry == null) { if (topHeadsUpEntry == null && row.mustStayOnScreen() && !childState.headsUpIsVisible) { topHeadsUpEntry = row; childState.location = ExpandableViewState.LOCATION_FIRST_HUN; } boolean isTopEntry = topHeadsUpEntry == row; float unmodifiedEndLocation = childState.yTranslation + childState.height; if (mIsExpanded) { if (row.mustStayOnScreen() && !childState.headsUpIsVisible) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0 && ambientState.isAboveShelf(row)) { Loading @@ -435,6 +442,7 @@ public class StackScrollAlgorithm { childState.hidden = false; } } } if (row.isPinned()) { childState.yTranslation = Math.max(childState.yTranslation, 0); childState.height = Math.max(row.getIntrinsicHeight(), childState.height); Loading Loading @@ -493,6 +501,7 @@ public class StackScrollAlgorithm { if (childViewState.yTranslation >= shelfStart) { childViewState.hidden = true; childViewState.inShelf = true; childViewState.headsUpIsVisible = false; } if (!ambientState.isShadeExpanded()) { childViewState.height = (int) (mStatusBarHeight - childViewState.yTranslation); Loading Loading @@ -531,7 +540,8 @@ public class StackScrollAlgorithm { ExpandableViewState childViewState = resultState.getViewStateForView(child); int zDistanceBetweenElements = ambientState.getZDistanceBetweenElements(); float baseZ = ambientState.getBaseZHeight(); if (child.mustStayOnScreen() && !ambientState.isDozingAndNotPulsing(child) if (child.mustStayOnScreen() && !childViewState.headsUpIsVisible && !ambientState.isDozingAndNotPulsing(child) && childViewState.yTranslation < ambientState.getTopPadding() + ambientState.getStackTranslation()) { if (childrenOnTop != 0.0f) { Loading