Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -2324,6 +2324,18 @@ public class NotificationPanelViewController extends PanelViewController { } } } } @Override protected boolean shouldExpandToTopOfClearAll(float targetHeight) { boolean perform = super.shouldExpandToTopOfClearAll(targetHeight); if (!perform) { return false; } // Let's make sure we're not appearing but the animation will end below the appear. // Otherwise quick settings would jump at the end of the animation. float fraction = mNotificationStackScroller.calculateAppearFraction(targetHeight); return fraction >= 1.0f; } @Override @Override protected boolean shouldUseDismissingAnimation() { protected boolean shouldUseDismissingAnimation() { return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +17 −5 Original line number Original line Diff line number Diff line Loading @@ -532,11 +532,8 @@ public abstract class PanelViewController { // Hack to make the expand transition look nice when clear all button is visible - we make // Hack to make the expand transition look nice when clear all button is visible - we make // the animation only to the last notification, and then jump to the maximum panel height so // the animation only to the last notification, and then jump to the maximum panel height so // clear all just fades in and the decelerating motion is towards the last notification. // clear all just fades in and the decelerating motion is towards the last notification. final boolean final boolean clearAllExpandHack = expand && clearAllExpandHack = shouldExpandToTopOfClearAll(getMaxPanelHeight() - getClearAllHeight()); expand && fullyExpandedClearAllVisible() && mExpandedHeight < getMaxPanelHeight() - getClearAllHeight() && !isClearAllVisible(); if (clearAllExpandHack) { if (clearAllExpandHack) { target = getMaxPanelHeight() - getClearAllHeight(); target = getMaxPanelHeight() - getClearAllHeight(); } } Loading Loading @@ -601,6 +598,21 @@ public abstract class PanelViewController { animator.start(); animator.start(); } } /** * When expanding, should we expand to the top of clear all and expand immediately? * This will make sure that the animation will stop smoothly at the end of the last notification * before the clear all affordance. * * @param targetHeight the height that we would animate to, right above clear all * * @return true if we can expand to the top of clear all */ protected boolean shouldExpandToTopOfClearAll(float targetHeight) { return fullyExpandedClearAllVisible() && mExpandedHeight < targetHeight && !isClearAllVisible(); } protected abstract boolean shouldUseDismissingAnimation(); protected abstract boolean shouldUseDismissingAnimation(); public String getName() { public String getName() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -2324,6 +2324,18 @@ public class NotificationPanelViewController extends PanelViewController { } } } } @Override protected boolean shouldExpandToTopOfClearAll(float targetHeight) { boolean perform = super.shouldExpandToTopOfClearAll(targetHeight); if (!perform) { return false; } // Let's make sure we're not appearing but the animation will end below the appear. // Otherwise quick settings would jump at the end of the animation. float fraction = mNotificationStackScroller.calculateAppearFraction(targetHeight); return fraction >= 1.0f; } @Override @Override protected boolean shouldUseDismissingAnimation() { protected boolean shouldUseDismissingAnimation() { return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() return mBarState != StatusBarState.SHADE && (mKeyguardStateController.canDismissLockScreen() Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +17 −5 Original line number Original line Diff line number Diff line Loading @@ -532,11 +532,8 @@ public abstract class PanelViewController { // Hack to make the expand transition look nice when clear all button is visible - we make // Hack to make the expand transition look nice when clear all button is visible - we make // the animation only to the last notification, and then jump to the maximum panel height so // the animation only to the last notification, and then jump to the maximum panel height so // clear all just fades in and the decelerating motion is towards the last notification. // clear all just fades in and the decelerating motion is towards the last notification. final boolean final boolean clearAllExpandHack = expand && clearAllExpandHack = shouldExpandToTopOfClearAll(getMaxPanelHeight() - getClearAllHeight()); expand && fullyExpandedClearAllVisible() && mExpandedHeight < getMaxPanelHeight() - getClearAllHeight() && !isClearAllVisible(); if (clearAllExpandHack) { if (clearAllExpandHack) { target = getMaxPanelHeight() - getClearAllHeight(); target = getMaxPanelHeight() - getClearAllHeight(); } } Loading Loading @@ -601,6 +598,21 @@ public abstract class PanelViewController { animator.start(); animator.start(); } } /** * When expanding, should we expand to the top of clear all and expand immediately? * This will make sure that the animation will stop smoothly at the end of the last notification * before the clear all affordance. * * @param targetHeight the height that we would animate to, right above clear all * * @return true if we can expand to the top of clear all */ protected boolean shouldExpandToTopOfClearAll(float targetHeight) { return fullyExpandedClearAllVisible() && mExpandedHeight < targetHeight && !isClearAllVisible(); } protected abstract boolean shouldUseDismissingAnimation(); protected abstract boolean shouldUseDismissingAnimation(); public String getName() { public String getName() { Loading