Merge "Translating QS during LS -> Shade transition" into sc-dev
This commit is contained in:
@@ -180,6 +180,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
|
||||
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.
|
||||
*/
|
||||
@@ -543,6 +548,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@@ -589,6 +599,11 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
* The animator for the qs clipping bounds.
|
||||
*/
|
||||
private ValueAnimator mQsClippingAnimation = null;
|
||||
|
||||
/**
|
||||
* Is the current animator resetting the qs translation.
|
||||
*/
|
||||
private boolean mIsQsTranslationResetAnimator;
|
||||
private final Rect mKeyguardStatusAreaClipBounds = new Rect();
|
||||
private final Region mQsInterceptRegion = new Region();
|
||||
|
||||
@@ -2325,6 +2340,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mQsClippingAnimation = null;
|
||||
mIsQsTranslationResetAnimator = false;
|
||||
}
|
||||
});
|
||||
mQsClippingAnimation.start();
|
||||
@@ -2348,7 +2364,18 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
statusBarClipTop = top - mKeyguardStatusBar.getTop();
|
||||
}
|
||||
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);
|
||||
}
|
||||
mKeyguardStatusViewController.setClipBounds(
|
||||
@@ -2485,6 +2512,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
if (animate && !mShouldUseSplitNotificationShade) {
|
||||
animateNextNotificationBounds(StackStateAnimator.ANIMATION_DURATION_GO_TO_FULL_SHADE,
|
||||
delay);
|
||||
mIsQsTranslationResetAnimator = mQsTranslationForFullShadeTransition > 0.0f;
|
||||
}
|
||||
|
||||
float endPosition = 0;
|
||||
@@ -2884,7 +2912,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
float startHeight = -mQsExpansionHeight;
|
||||
if (!mShouldUseSplitNotificationShade && mBarState == StatusBarState.SHADE) {
|
||||
// Small parallax as we pull down and clip QS
|
||||
startHeight = -mQsExpansionHeight * 0.2f;
|
||||
startHeight = -mQsExpansionHeight * QS_PARALLAX_AMOUNT;
|
||||
}
|
||||
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
||||
if (mNotificationStackScrollLayoutController.isPulseExpanding()) {
|
||||
@@ -3066,10 +3094,15 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
super.setOverExpansion(overExpansion);
|
||||
// Translating the quick settings by half the overexpansion to center it in the background
|
||||
// frame
|
||||
mQsFrame.setTranslationY(overExpansion / 2f);
|
||||
updateQsFrameTranslation();
|
||||
mNotificationStackScrollLayoutController.setOverExpansion(overExpansion);
|
||||
}
|
||||
|
||||
private void updateQsFrameTranslation() {
|
||||
float translation = mOverExpansion / 2.0f + mQsTranslationForFullShadeTransition;
|
||||
mQsFrame.setTranslationY(translation);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTrackingStarted() {
|
||||
mFalsingCollector.onTrackingStarted(!mKeyguardStateController.canDismissLockScreen());
|
||||
|
||||
Reference in New Issue
Block a user