Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −2 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class NotificationShelf extends ActivatableNotificationView implements viewState.openedAmount = openedAmount; viewState.clipTopAmount = 0; viewState.alpha = 1; viewState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0; viewState.belowSpeedBump = mHostLayoutController.getSpeedBumpIndex() == 0; viewState.hideSensitive = false; viewState.xTranslation = getTranslationX(); if (mNotGoneIndex != -1) { Loading Loading @@ -352,7 +352,7 @@ public class NotificationShelf extends ActivatableNotificationView implements } setBackgroundTop(backgroundTop); setFirstElementRoundness(firstElementRoundness); mShelfIcons.setSpeedBumpIndex(mAmbientState.getSpeedBumpIndex()); mShelfIcons.setSpeedBumpIndex(mHostLayoutController.getSpeedBumpIndex()); mShelfIcons.calculateIconTranslations(); mShelfIcons.applyIconStates(); for (int i = 0; i < mHostLayoutController.getChildCount(); i++) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +0 −10 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.SectionProvider; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.ArrayList; Loading @@ -50,7 +49,6 @@ public class AmbientState { private ActivatableNotificationView mActivatedChild; private float mOverScrollTopAmount; private float mOverScrollBottomAmount; private int mSpeedBumpIndex = -1; private boolean mDozing; private boolean mHideSensitive; private float mStackTranslation; Loading Loading @@ -245,14 +243,6 @@ public class AmbientState { return top ? mOverScrollTopAmount : mOverScrollBottomAmount; } public int getSpeedBumpIndex() { return mSpeedBumpIndex; } public void setSpeedBumpIndex(int shelfIndex) { mSpeedBumpIndex = shelfIndex; } public SectionProvider getSectionProvider() { return mSectionProvider; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +33 −32 Original line number Diff line number Diff line Loading @@ -248,6 +248,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private boolean mChangePositionInProgress; private boolean mChildTransferInProgress; private int mSpeedBumpIndex = -1; private boolean mSpeedBumpIndexDirty = true; /** * The raw amount of the overScroll on the top, which is not rubber-banded. */ Loading Loading @@ -444,7 +447,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private int mMaxDisplayedNotifications = -1; private int mStatusBarHeight; private int mMinInteractionHeight; private boolean mNoAmbient; private final Rect mClipRect = new Rect(); private boolean mIsClipped; private Rect mRequestedClipBounds; Loading Loading @@ -1010,7 +1012,33 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } public int getSpeedBumpIndex() { return mAmbientState.getSpeedBumpIndex(); if (mSpeedBumpIndexDirty) { mSpeedBumpIndexDirty = false; int speedBumpIndex = 0; int currentIndex = 0; final int n = getChildCount(); for (int i = 0; i < n; i++) { View view = getChildAt(i); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; currentIndex++; boolean beforeSpeedBump; if (mHighPriorityBeforeSpeedBump) { beforeSpeedBump = row.getEntry().getBucket() < BUCKET_SILENT; } else { beforeSpeedBump = !row.getEntry().isAmbient(); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; } } mSpeedBumpIndex = speedBumpIndex; } return mSpeedBumpIndex; } @Override Loading Loading @@ -1066,12 +1094,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } @ShadeViewRefactor(RefactorComponent.ADAPTER) private void setSpeedBumpIndex(int newIndex, boolean noAmbient) { mAmbientState.setSpeedBumpIndex(newIndex); mNoAmbient = noAmbient; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setChildLocationsChangedListener( NotificationLogger.OnChildLocationsChangedListener listener) { Loading Loading @@ -1135,7 +1157,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } else { mAmbientState.setScrollY(mOwnScrollY); } mStackScrollAlgorithm.resetViewStates(mAmbientState); mStackScrollAlgorithm.resetViewStates(mAmbientState, getSpeedBumpIndex()); if (!isCurrentlyAnimating() && !mNeedsAnimation) { applyCurrentState(); } else { Loading Loading @@ -5789,28 +5811,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) private void updateSpeedBumpIndex() { int speedBumpIndex = 0; int currentIndex = 0; final int N = getChildCount(); for (int i = 0; i < N; i++) { View view = getChildAt(i); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; currentIndex++; boolean beforeSpeedBump; if (mHighPriorityBeforeSpeedBump) { beforeSpeedBump = row.getEntry().getBucket() < BUCKET_SILENT; } else { beforeSpeedBump = !row.getEntry().isAmbient(); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; } } boolean noAmbient = speedBumpIndex == N; setSpeedBumpIndex(speedBumpIndex, noAmbient); mSpeedBumpIndexDirty = true; } /** Updates the indices of the boundaries between sections. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −0 Original line number Diff line number Diff line Loading @@ -713,6 +713,10 @@ public class NotificationStackScrollLayoutController { return mView.getWakeUpHeight(); } public int getSpeedBumpIndex() { return mView.getSpeedBumpIndex(); } public void setHideAmount(float linearAmount, float amount) { mView.setHideAmount(linearAmount, amount); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +4 −4 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ public class StackScrollAlgorithm { /** * Updates the state of all children in the hostview based on this algorithm. */ public void resetViewStates(AmbientState ambientState) { public void resetViewStates(AmbientState ambientState, int speedBumpIndex) { // The state of the local variables are saved in an algorithmState to easily subdivide it // into multiple phases. StackScrollAlgorithmState algorithmState = mTempAlgorithmState; Loading @@ -110,7 +110,7 @@ public class StackScrollAlgorithm { updateDimmedActivatedHideSensitive(ambientState, algorithmState); updateClipping(algorithmState, ambientState); updateSpeedBumpState(algorithmState, ambientState); updateSpeedBumpState(algorithmState, speedBumpIndex); updateShelfState(ambientState); getNotificationChildrenStates(algorithmState, ambientState); } Loading @@ -136,9 +136,9 @@ public class StackScrollAlgorithm { } private void updateSpeedBumpState(StackScrollAlgorithmState algorithmState, AmbientState ambientState) { int speedBumpIndex) { int childCount = algorithmState.visibleChildren.size(); int belowSpeedBump = ambientState.getSpeedBumpIndex(); int belowSpeedBump = speedBumpIndex; for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState childViewState = child.getViewState(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −2 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class NotificationShelf extends ActivatableNotificationView implements viewState.openedAmount = openedAmount; viewState.clipTopAmount = 0; viewState.alpha = 1; viewState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0; viewState.belowSpeedBump = mHostLayoutController.getSpeedBumpIndex() == 0; viewState.hideSensitive = false; viewState.xTranslation = getTranslationX(); if (mNotGoneIndex != -1) { Loading Loading @@ -352,7 +352,7 @@ public class NotificationShelf extends ActivatableNotificationView implements } setBackgroundTop(backgroundTop); setFirstElementRoundness(firstElementRoundness); mShelfIcons.setSpeedBumpIndex(mAmbientState.getSpeedBumpIndex()); mShelfIcons.setSpeedBumpIndex(mHostLayoutController.getSpeedBumpIndex()); mShelfIcons.calculateIconTranslations(); mShelfIcons.applyIconStates(); for (int i = 0; i < mHostLayoutController.getChildCount(); i++) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +0 −10 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import com.android.systemui.statusbar.notification.row.ActivatableNotificationVi import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.SectionProvider; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.ArrayList; Loading @@ -50,7 +49,6 @@ public class AmbientState { private ActivatableNotificationView mActivatedChild; private float mOverScrollTopAmount; private float mOverScrollBottomAmount; private int mSpeedBumpIndex = -1; private boolean mDozing; private boolean mHideSensitive; private float mStackTranslation; Loading Loading @@ -245,14 +243,6 @@ public class AmbientState { return top ? mOverScrollTopAmount : mOverScrollBottomAmount; } public int getSpeedBumpIndex() { return mSpeedBumpIndex; } public void setSpeedBumpIndex(int shelfIndex) { mSpeedBumpIndex = shelfIndex; } public SectionProvider getSectionProvider() { return mSectionProvider; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +33 −32 Original line number Diff line number Diff line Loading @@ -248,6 +248,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private boolean mChangePositionInProgress; private boolean mChildTransferInProgress; private int mSpeedBumpIndex = -1; private boolean mSpeedBumpIndexDirty = true; /** * The raw amount of the overScroll on the top, which is not rubber-banded. */ Loading Loading @@ -444,7 +447,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private int mMaxDisplayedNotifications = -1; private int mStatusBarHeight; private int mMinInteractionHeight; private boolean mNoAmbient; private final Rect mClipRect = new Rect(); private boolean mIsClipped; private Rect mRequestedClipBounds; Loading Loading @@ -1010,7 +1012,33 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } public int getSpeedBumpIndex() { return mAmbientState.getSpeedBumpIndex(); if (mSpeedBumpIndexDirty) { mSpeedBumpIndexDirty = false; int speedBumpIndex = 0; int currentIndex = 0; final int n = getChildCount(); for (int i = 0; i < n; i++) { View view = getChildAt(i); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; currentIndex++; boolean beforeSpeedBump; if (mHighPriorityBeforeSpeedBump) { beforeSpeedBump = row.getEntry().getBucket() < BUCKET_SILENT; } else { beforeSpeedBump = !row.getEntry().isAmbient(); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; } } mSpeedBumpIndex = speedBumpIndex; } return mSpeedBumpIndex; } @Override Loading Loading @@ -1066,12 +1094,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } @ShadeViewRefactor(RefactorComponent.ADAPTER) private void setSpeedBumpIndex(int newIndex, boolean noAmbient) { mAmbientState.setSpeedBumpIndex(newIndex); mNoAmbient = noAmbient; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setChildLocationsChangedListener( NotificationLogger.OnChildLocationsChangedListener listener) { Loading Loading @@ -1135,7 +1157,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } else { mAmbientState.setScrollY(mOwnScrollY); } mStackScrollAlgorithm.resetViewStates(mAmbientState); mStackScrollAlgorithm.resetViewStates(mAmbientState, getSpeedBumpIndex()); if (!isCurrentlyAnimating() && !mNeedsAnimation) { applyCurrentState(); } else { Loading Loading @@ -5789,28 +5811,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) private void updateSpeedBumpIndex() { int speedBumpIndex = 0; int currentIndex = 0; final int N = getChildCount(); for (int i = 0; i < N; i++) { View view = getChildAt(i); if (view.getVisibility() == View.GONE || !(view instanceof ExpandableNotificationRow)) { continue; } ExpandableNotificationRow row = (ExpandableNotificationRow) view; currentIndex++; boolean beforeSpeedBump; if (mHighPriorityBeforeSpeedBump) { beforeSpeedBump = row.getEntry().getBucket() < BUCKET_SILENT; } else { beforeSpeedBump = !row.getEntry().isAmbient(); } if (beforeSpeedBump) { speedBumpIndex = currentIndex; } } boolean noAmbient = speedBumpIndex == N; setSpeedBumpIndex(speedBumpIndex, noAmbient); mSpeedBumpIndexDirty = true; } /** Updates the indices of the boundaries between sections. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +4 −0 Original line number Diff line number Diff line Loading @@ -713,6 +713,10 @@ public class NotificationStackScrollLayoutController { return mView.getWakeUpHeight(); } public int getSpeedBumpIndex() { return mView.getSpeedBumpIndex(); } public void setHideAmount(float linearAmount, float amount) { mView.setHideAmount(linearAmount, amount); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +4 −4 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ public class StackScrollAlgorithm { /** * Updates the state of all children in the hostview based on this algorithm. */ public void resetViewStates(AmbientState ambientState) { public void resetViewStates(AmbientState ambientState, int speedBumpIndex) { // The state of the local variables are saved in an algorithmState to easily subdivide it // into multiple phases. StackScrollAlgorithmState algorithmState = mTempAlgorithmState; Loading @@ -110,7 +110,7 @@ public class StackScrollAlgorithm { updateDimmedActivatedHideSensitive(ambientState, algorithmState); updateClipping(algorithmState, ambientState); updateSpeedBumpState(algorithmState, ambientState); updateSpeedBumpState(algorithmState, speedBumpIndex); updateShelfState(ambientState); getNotificationChildrenStates(algorithmState, ambientState); } Loading @@ -136,9 +136,9 @@ public class StackScrollAlgorithm { } private void updateSpeedBumpState(StackScrollAlgorithmState algorithmState, AmbientState ambientState) { int speedBumpIndex) { int childCount = algorithmState.visibleChildren.size(); int belowSpeedBump = ambientState.getSpeedBumpIndex(); int belowSpeedBump = speedBumpIndex; for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState childViewState = child.getViewState(); Loading