Merge "Translating QS during LS -> Shade transition" into sc-dev am: 3899455d37
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175433 Change-Id: Iec9eb250a8daf4eb655e40d119ea1e7d5b303752
This commit is contained in:
@@ -180,6 +180,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
|
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The parallax amount of the quick settings translation when dragging down the panel
|
||||||
|
*/
|
||||||
|
private static final float QS_PARALLAX_AMOUNT = 0.175f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fling expanding QS.
|
* Fling expanding QS.
|
||||||
*/
|
*/
|
||||||
@@ -543,6 +548,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
*/
|
*/
|
||||||
private int mDistanceForQSFullShadeTransition;
|
private int mDistanceForQSFullShadeTransition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The translation amount for QS for the full shade transition
|
||||||
|
*/
|
||||||
|
private float mQsTranslationForFullShadeTransition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum overshoot allowed for the top padding for the full shade transition
|
* The maximum overshoot allowed for the top padding for the full shade transition
|
||||||
*/
|
*/
|
||||||
@@ -589,6 +599,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
* The animator for the qs clipping bounds.
|
* The animator for the qs clipping bounds.
|
||||||
*/
|
*/
|
||||||
private ValueAnimator mQsClippingAnimation = null;
|
private ValueAnimator mQsClippingAnimation = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the current animator resetting the qs translation.
|
||||||
|
*/
|
||||||
|
private boolean mIsQsTranslationResetAnimator;
|
||||||
private final Rect mKeyguardStatusAreaClipBounds = new Rect();
|
private final Rect mKeyguardStatusAreaClipBounds = new Rect();
|
||||||
private final Region mQsInterceptRegion = new Region();
|
private final Region mQsInterceptRegion = new Region();
|
||||||
|
|
||||||
@@ -2325,6 +2340,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
mQsClippingAnimation = null;
|
mQsClippingAnimation = null;
|
||||||
|
mIsQsTranslationResetAnimator = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mQsClippingAnimation.start();
|
mQsClippingAnimation.start();
|
||||||
@@ -2348,7 +2364,18 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
statusBarClipTop = top - mKeyguardStatusBar.getTop();
|
statusBarClipTop = top - mKeyguardStatusBar.getTop();
|
||||||
}
|
}
|
||||||
if (mQs != null) {
|
if (mQs != null) {
|
||||||
mQs.setFancyClipping(top, bottom, radius, qsVisible
|
float qsTranslation = 0;
|
||||||
|
if (mTransitioningToFullShadeProgress > 0.0f || (mQsClippingAnimation != null
|
||||||
|
&& mIsQsTranslationResetAnimator)) {
|
||||||
|
qsTranslation = (top - mQs.getHeader().getHeight()) * QS_PARALLAX_AMOUNT;
|
||||||
|
}
|
||||||
|
mQsTranslationForFullShadeTransition = qsTranslation;
|
||||||
|
updateQsFrameTranslation();
|
||||||
|
float currentTranslation = mQsFrame.getTranslationY();
|
||||||
|
mQs.setFancyClipping((
|
||||||
|
int) (top - currentTranslation),
|
||||||
|
(int) (bottom - currentTranslation),
|
||||||
|
radius, qsVisible
|
||||||
&& !mShouldUseSplitNotificationShade);
|
&& !mShouldUseSplitNotificationShade);
|
||||||
}
|
}
|
||||||
mKeyguardStatusViewController.setClipBounds(
|
mKeyguardStatusViewController.setClipBounds(
|
||||||
@@ -2485,6 +2512,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
if (animate && !mShouldUseSplitNotificationShade) {
|
if (animate && !mShouldUseSplitNotificationShade) {
|
||||||
animateNextNotificationBounds(StackStateAnimator.ANIMATION_DURATION_GO_TO_FULL_SHADE,
|
animateNextNotificationBounds(StackStateAnimator.ANIMATION_DURATION_GO_TO_FULL_SHADE,
|
||||||
delay);
|
delay);
|
||||||
|
mIsQsTranslationResetAnimator = mQsTranslationForFullShadeTransition > 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float endPosition = 0;
|
float endPosition = 0;
|
||||||
@@ -2884,7 +2912,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
float startHeight = -mQsExpansionHeight;
|
float startHeight = -mQsExpansionHeight;
|
||||||
if (!mShouldUseSplitNotificationShade && mBarState == StatusBarState.SHADE) {
|
if (!mShouldUseSplitNotificationShade && mBarState == StatusBarState.SHADE) {
|
||||||
// Small parallax as we pull down and clip QS
|
// Small parallax as we pull down and clip QS
|
||||||
startHeight = -mQsExpansionHeight * 0.2f;
|
startHeight = -mQsExpansionHeight * QS_PARALLAX_AMOUNT;
|
||||||
}
|
}
|
||||||
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
||||||
if (mNotificationStackScrollLayoutController.isPulseExpanding()) {
|
if (mNotificationStackScrollLayoutController.isPulseExpanding()) {
|
||||||
@@ -3066,10 +3094,15 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
super.setOverExpansion(overExpansion);
|
super.setOverExpansion(overExpansion);
|
||||||
// Translating the quick settings by half the overexpansion to center it in the background
|
// Translating the quick settings by half the overexpansion to center it in the background
|
||||||
// frame
|
// frame
|
||||||
mQsFrame.setTranslationY(overExpansion / 2f);
|
updateQsFrameTranslation();
|
||||||
mNotificationStackScrollLayoutController.setOverExpansion(overExpansion);
|
mNotificationStackScrollLayoutController.setOverExpansion(overExpansion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateQsFrameTranslation() {
|
||||||
|
float translation = mOverExpansion / 2.0f + mQsTranslationForFullShadeTransition;
|
||||||
|
mQsFrame.setTranslationY(translation);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onTrackingStarted() {
|
protected void onTrackingStarted() {
|
||||||
mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen());
|
mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen());
|
||||||
|
|||||||
Reference in New Issue
Block a user