Loading packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +4 −5 Original line number Diff line number Diff line Loading @@ -299,10 +299,10 @@ public class NotificationPanelViewController extends OverlayPanelViewController // The glass pane is used to view touch events before passed to the notification list. // This allows us to initialize gesture listeners and detect when to close the notifications glassPane.setOnTouchListener((v, event) -> { if (event.getActionMasked() == MotionEvent.ACTION_UP) { if (isClosingAction(event)) { mNotificationListAtEndAtTimeOfTouch = false; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { if (isOpeningAction(event)) { mFirstTouchDownOnGlassPane = event.getRawX(); mNotificationListAtEndAtTimeOfTouch = mNotificationListAtEnd; // Reset the tracker when there is a touch down on the glass pane. Loading Loading @@ -355,8 +355,7 @@ public class NotificationPanelViewController extends OverlayPanelViewController if (rect != null) { clippedHeight = rect.bottom; } if (!handled && event.getActionMasked() == MotionEvent.ACTION_UP && mIsSwipingVerticallyToClose) { if (!handled && isClosingAction(event) && mIsSwipingVerticallyToClose) { if (getSettleClosePercentage() < getPercentageFromEndingEdge() && isTracking) { animatePanel(DEFAULT_FLING_VELOCITY, false); } else if (clippedHeight != getLayout().getHeight() && isTracking) { Loading @@ -369,7 +368,7 @@ public class NotificationPanelViewController extends OverlayPanelViewController // Updating the mNotificationListAtEndAtTimeOfTouch state has to be done after // the event has been passed to the closeGestureDetector above, such that the // closeGestureDetector sees the up event before the state has changed. if (event.getActionMasked() == MotionEvent.ACTION_UP) { if (isClosingAction(event)) { mNotificationListAtEndAtTimeOfTouch = false; } return handled || isTracking; Loading packages/CarSystemUI/src/com/android/systemui/car/window/OverlayPanelViewController.java +33 −2 Original line number Diff line number Diff line Loading @@ -191,6 +191,38 @@ public abstract class OverlayPanelViewController extends OverlayViewController { } } /** Checks if a {@link MotionEvent} is an action to open the panel. * @param e {@link MotionEvent} to check. * @return true only if opening action. */ protected boolean isOpeningAction(MotionEvent e) { if (mAnimateDirection == POSITIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_DOWN; } if (mAnimateDirection == NEGATIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_UP; } return false; } /** Checks if a {@link MotionEvent} is an action to close the panel. * @param e {@link MotionEvent} to check. * @return true only if closing action. */ protected boolean isClosingAction(MotionEvent e) { if (mAnimateDirection == POSITIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_UP; } if (mAnimateDirection == NEGATIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_DOWN; } return false; } /* ***************************************************************************************** * * Panel Animation * ***************************************************************************************** */ Loading Loading @@ -243,8 +275,7 @@ public abstract class OverlayPanelViewController extends OverlayViewController { * Depending on certain conditions, determines whether to fully expand or collapse the panel. */ protected void maybeCompleteAnimation(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_UP && isPanelVisible()) { if (isClosingAction(event) && isPanelVisible()) { if (mSettleClosePercentage < mPercentageFromEndingEdge) { animatePanel(DEFAULT_FLING_VELOCITY, false); } else { Loading Loading
packages/CarSystemUI/src/com/android/systemui/car/notification/NotificationPanelViewController.java +4 −5 Original line number Diff line number Diff line Loading @@ -299,10 +299,10 @@ public class NotificationPanelViewController extends OverlayPanelViewController // The glass pane is used to view touch events before passed to the notification list. // This allows us to initialize gesture listeners and detect when to close the notifications glassPane.setOnTouchListener((v, event) -> { if (event.getActionMasked() == MotionEvent.ACTION_UP) { if (isClosingAction(event)) { mNotificationListAtEndAtTimeOfTouch = false; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { if (isOpeningAction(event)) { mFirstTouchDownOnGlassPane = event.getRawX(); mNotificationListAtEndAtTimeOfTouch = mNotificationListAtEnd; // Reset the tracker when there is a touch down on the glass pane. Loading Loading @@ -355,8 +355,7 @@ public class NotificationPanelViewController extends OverlayPanelViewController if (rect != null) { clippedHeight = rect.bottom; } if (!handled && event.getActionMasked() == MotionEvent.ACTION_UP && mIsSwipingVerticallyToClose) { if (!handled && isClosingAction(event) && mIsSwipingVerticallyToClose) { if (getSettleClosePercentage() < getPercentageFromEndingEdge() && isTracking) { animatePanel(DEFAULT_FLING_VELOCITY, false); } else if (clippedHeight != getLayout().getHeight() && isTracking) { Loading @@ -369,7 +368,7 @@ public class NotificationPanelViewController extends OverlayPanelViewController // Updating the mNotificationListAtEndAtTimeOfTouch state has to be done after // the event has been passed to the closeGestureDetector above, such that the // closeGestureDetector sees the up event before the state has changed. if (event.getActionMasked() == MotionEvent.ACTION_UP) { if (isClosingAction(event)) { mNotificationListAtEndAtTimeOfTouch = false; } return handled || isTracking; Loading
packages/CarSystemUI/src/com/android/systemui/car/window/OverlayPanelViewController.java +33 −2 Original line number Diff line number Diff line Loading @@ -191,6 +191,38 @@ public abstract class OverlayPanelViewController extends OverlayViewController { } } /** Checks if a {@link MotionEvent} is an action to open the panel. * @param e {@link MotionEvent} to check. * @return true only if opening action. */ protected boolean isOpeningAction(MotionEvent e) { if (mAnimateDirection == POSITIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_DOWN; } if (mAnimateDirection == NEGATIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_UP; } return false; } /** Checks if a {@link MotionEvent} is an action to close the panel. * @param e {@link MotionEvent} to check. * @return true only if closing action. */ protected boolean isClosingAction(MotionEvent e) { if (mAnimateDirection == POSITIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_UP; } if (mAnimateDirection == NEGATIVE_DIRECTION) { return e.getActionMasked() == MotionEvent.ACTION_DOWN; } return false; } /* ***************************************************************************************** * * Panel Animation * ***************************************************************************************** */ Loading Loading @@ -243,8 +275,7 @@ public abstract class OverlayPanelViewController extends OverlayViewController { * Depending on certain conditions, determines whether to fully expand or collapse the panel. */ protected void maybeCompleteAnimation(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_UP && isPanelVisible()) { if (isClosingAction(event) && isPanelVisible()) { if (mSettleClosePercentage < mPercentageFromEndingEdge) { animatePanel(DEFAULT_FLING_VELOCITY, false); } else { Loading