Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +35 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,16 @@ public class AmbientState { /** Whether we are swiping up. */ private boolean mIsSwipingUp; /** Whether we are flinging the shade open or closed. */ private boolean mIsFlinging; /** * Whether we need to do a fling down after swiping up on lockscreen. * True right after we swipe up on lockscreen and have not finished the fling down that follows. * False when we stop flinging or leave lockscreen. */ private boolean mNeedFlingAfterLockscreenSwipeUp = false; /** * @return Height of the notifications panel without top padding when expansion completes. */ Loading Loading @@ -142,6 +152,10 @@ public class AmbientState { * @param isSwipingUp Whether we are swiping up. */ public void setSwipingUp(boolean isSwipingUp) { if (!isSwipingUp && mIsSwipingUp) { // Just stopped swiping up. mNeedFlingAfterLockscreenSwipeUp = true; } mIsSwipingUp = isSwipingUp; } Loading @@ -152,6 +166,17 @@ public class AmbientState { return mIsSwipingUp; } /** * @param isFlinging Whether we are flinging the shade open or closed. */ public void setIsFlinging(boolean isFlinging) { if (isOnKeyguard() && !isFlinging && mIsFlinging) { // Just stopped flinging. mNeedFlingAfterLockscreenSwipeUp = false; } mIsFlinging = isFlinging; } /** * @return Fraction of shade expansion. */ Loading Loading @@ -459,6 +484,9 @@ public class AmbientState { } public void setStatusBarState(int statusBarState) { if (mStatusBarState != StatusBarState.KEYGUARD) { mNeedFlingAfterLockscreenSwipeUp = false; } mStatusBarState = statusBarState; } Loading Loading @@ -521,6 +549,13 @@ public class AmbientState { return mUnlockHintRunning; } /** * @return Whether we need to do a fling down after swiping up on lockscreen. */ public boolean isFlingingAfterSwipeUpOnLockscreen() { return mIsFlinging && mNeedFlingAfterLockscreenSwipeUp; } /** * @return whether a view is dozing and not pulsing right now */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −15 Original line number Diff line number Diff line Loading @@ -202,9 +202,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private float mQsExpansionFraction; private final int mSplitShadeMinContentHeight; /** Whether we are flinging the shade open or closed. */ private boolean mIsFlinging; /** * The algorithm which calculates the properties for our children */ Loading Loading @@ -1263,13 +1260,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } /** * @return Whether we should skip stack height update for lockscreen swipe-up or unlock hint. * @return Whether we should skip stack height updates. * True when * 1) Unlock hint is running * 2) Swiping up on lockscreen or flinging down after swipe up */ private boolean shouldSkipHeightUpdate() { // After the user swipes up on lockscreen and lets go, // {@link PanelViewController) flings the shade back down. return mAmbientState.isOnKeyguard() && ( mAmbientState.isUnlockHintRunning() || mAmbientState.isSwipingUp() || mIsFlinging); return mAmbientState.isOnKeyguard() && (mAmbientState.isUnlockHintRunning() || mAmbientState.isSwipingUp() || mAmbientState.isFlingingAfterSwipeUpOnLockscreen()); } /** Loading Loading @@ -5009,13 +5009,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mAmbientState.setUnlockHintRunning(running); } /** * @param isFlinging Whether we are flinging the shade open or closed. */ public void setIsFlinging(boolean isFlinging) { mIsFlinging = isFlinging; } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setHeadsUpGoingAwayAnimationsAllowed(boolean headsUpGoingAwayAnimationsAllowed) { mHeadsUpGoingAwayAnimationsAllowed = headsUpGoingAwayAnimationsAllowed; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +0 −7 Original line number Diff line number Diff line Loading @@ -1181,13 +1181,6 @@ public class NotificationStackScrollLayoutController { mView.setUnlockHintRunning(running); } /** * @param isFlinging Whether we are flinging the shade open or close. */ public void setIsFlinging(boolean isFlinging) { mView.setIsFlinging(isFlinging); } public boolean isFooterViewNotGone() { return mView.isFooterViewNotGone(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1758,14 +1758,14 @@ public class NotificationPanelViewController extends PanelViewController { mHeadsUpTouchHelper.notifyFling(!expand); mKeyguardStateController.notifyPanelFlingStart(!expand /* flingingToDismiss */); setClosingWithAlphaFadeout(!expand && !isOnKeyguard() && getFadeoutAlpha() == 1.0f); mNotificationStackScrollLayoutController.setIsFlinging(true); mAmbientState.setIsFlinging(true); super.flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing); } @Override protected void onFlingEnd(boolean cancelled) { super.onFlingEnd(cancelled); mNotificationStackScrollLayoutController.setIsFlinging(false); mAmbientState.setIsFlinging(false); } private boolean onQsIntercept(MotionEvent event) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -397,6 +397,7 @@ public abstract class PanelViewController { private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) { mTrackingPointer = -1; mAmbientState.setSwipingUp(false); if ((mTracking && mTouchSlopExceeded) || Math.abs(x - mInitialTouchX) > mTouchSlop || Math.abs(y - mInitialTouchY) > mTouchSlop || event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel) { Loading Loading @@ -460,7 +461,6 @@ public abstract class PanelViewController { boolean expands = onEmptySpaceClick(mInitialTouchX); onTrackingStopped(expands); } mAmbientState.setSwipingUp(false); mVelocityTracker.clear(); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +35 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,16 @@ public class AmbientState { /** Whether we are swiping up. */ private boolean mIsSwipingUp; /** Whether we are flinging the shade open or closed. */ private boolean mIsFlinging; /** * Whether we need to do a fling down after swiping up on lockscreen. * True right after we swipe up on lockscreen and have not finished the fling down that follows. * False when we stop flinging or leave lockscreen. */ private boolean mNeedFlingAfterLockscreenSwipeUp = false; /** * @return Height of the notifications panel without top padding when expansion completes. */ Loading Loading @@ -142,6 +152,10 @@ public class AmbientState { * @param isSwipingUp Whether we are swiping up. */ public void setSwipingUp(boolean isSwipingUp) { if (!isSwipingUp && mIsSwipingUp) { // Just stopped swiping up. mNeedFlingAfterLockscreenSwipeUp = true; } mIsSwipingUp = isSwipingUp; } Loading @@ -152,6 +166,17 @@ public class AmbientState { return mIsSwipingUp; } /** * @param isFlinging Whether we are flinging the shade open or closed. */ public void setIsFlinging(boolean isFlinging) { if (isOnKeyguard() && !isFlinging && mIsFlinging) { // Just stopped flinging. mNeedFlingAfterLockscreenSwipeUp = false; } mIsFlinging = isFlinging; } /** * @return Fraction of shade expansion. */ Loading Loading @@ -459,6 +484,9 @@ public class AmbientState { } public void setStatusBarState(int statusBarState) { if (mStatusBarState != StatusBarState.KEYGUARD) { mNeedFlingAfterLockscreenSwipeUp = false; } mStatusBarState = statusBarState; } Loading Loading @@ -521,6 +549,13 @@ public class AmbientState { return mUnlockHintRunning; } /** * @return Whether we need to do a fling down after swiping up on lockscreen. */ public boolean isFlingingAfterSwipeUpOnLockscreen() { return mIsFlinging && mNeedFlingAfterLockscreenSwipeUp; } /** * @return whether a view is dozing and not pulsing right now */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −15 Original line number Diff line number Diff line Loading @@ -202,9 +202,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private float mQsExpansionFraction; private final int mSplitShadeMinContentHeight; /** Whether we are flinging the shade open or closed. */ private boolean mIsFlinging; /** * The algorithm which calculates the properties for our children */ Loading Loading @@ -1263,13 +1260,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } /** * @return Whether we should skip stack height update for lockscreen swipe-up or unlock hint. * @return Whether we should skip stack height updates. * True when * 1) Unlock hint is running * 2) Swiping up on lockscreen or flinging down after swipe up */ private boolean shouldSkipHeightUpdate() { // After the user swipes up on lockscreen and lets go, // {@link PanelViewController) flings the shade back down. return mAmbientState.isOnKeyguard() && ( mAmbientState.isUnlockHintRunning() || mAmbientState.isSwipingUp() || mIsFlinging); return mAmbientState.isOnKeyguard() && (mAmbientState.isUnlockHintRunning() || mAmbientState.isSwipingUp() || mAmbientState.isFlingingAfterSwipeUpOnLockscreen()); } /** Loading Loading @@ -5009,13 +5009,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mAmbientState.setUnlockHintRunning(running); } /** * @param isFlinging Whether we are flinging the shade open or closed. */ public void setIsFlinging(boolean isFlinging) { mIsFlinging = isFlinging; } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setHeadsUpGoingAwayAnimationsAllowed(boolean headsUpGoingAwayAnimationsAllowed) { mHeadsUpGoingAwayAnimationsAllowed = headsUpGoingAwayAnimationsAllowed; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +0 −7 Original line number Diff line number Diff line Loading @@ -1181,13 +1181,6 @@ public class NotificationStackScrollLayoutController { mView.setUnlockHintRunning(running); } /** * @param isFlinging Whether we are flinging the shade open or close. */ public void setIsFlinging(boolean isFlinging) { mView.setIsFlinging(isFlinging); } public boolean isFooterViewNotGone() { return mView.isFooterViewNotGone(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1758,14 +1758,14 @@ public class NotificationPanelViewController extends PanelViewController { mHeadsUpTouchHelper.notifyFling(!expand); mKeyguardStateController.notifyPanelFlingStart(!expand /* flingingToDismiss */); setClosingWithAlphaFadeout(!expand && !isOnKeyguard() && getFadeoutAlpha() == 1.0f); mNotificationStackScrollLayoutController.setIsFlinging(true); mAmbientState.setIsFlinging(true); super.flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing); } @Override protected void onFlingEnd(boolean cancelled) { super.onFlingEnd(cancelled); mNotificationStackScrollLayoutController.setIsFlinging(false); mAmbientState.setIsFlinging(false); } private boolean onQsIntercept(MotionEvent event) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -397,6 +397,7 @@ public abstract class PanelViewController { private void endMotionEvent(MotionEvent event, float x, float y, boolean forceCancel) { mTrackingPointer = -1; mAmbientState.setSwipingUp(false); if ((mTracking && mTouchSlopExceeded) || Math.abs(x - mInitialTouchX) > mTouchSlop || Math.abs(y - mInitialTouchY) > mTouchSlop || event.getActionMasked() == MotionEvent.ACTION_CANCEL || forceCancel) { Loading Loading @@ -460,7 +461,6 @@ public abstract class PanelViewController { boolean expands = onEmptySpaceClick(mInitialTouchX); onTrackingStopped(expands); } mAmbientState.setSwipingUp(false); mVelocityTracker.clear(); } Loading