Merge "Fixing reading shade expansion progress when user pulls from the top of lockscreen" into tm-qpr-dev

This commit is contained in:
Michał Brzeziński
2022-10-04 12:38:40 +00:00
committed by Android (Google) Code Review

View File

@@ -2482,17 +2482,23 @@ public final class NotificationPanelViewController extends PanelViewController {
mDepthController.setQsPanelExpansion(qsExpansionFraction); mDepthController.setQsPanelExpansion(qsExpansionFraction);
mStatusBarKeyguardViewManager.setQsExpansion(qsExpansionFraction); mStatusBarKeyguardViewManager.setQsExpansion(qsExpansionFraction);
// updateQsExpansion will get called whenever mTransitionToFullShadeProgress or float shadeExpandedFraction = isOnKeyguard()
// mLockscreenShadeTransitionController.getDragProgress change. ? getLockscreenShadeDragProgress()
// When in lockscreen, getDragProgress indicates the true expanded fraction of QS
float shadeExpandedFraction = mTransitioningToFullShadeProgress > 0
? mLockscreenShadeTransitionController.getQSDragProgress()
: getExpandedFraction(); : getExpandedFraction();
mLargeScreenShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction); mLargeScreenShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction);
mLargeScreenShadeHeaderController.setQsExpandedFraction(qsExpansionFraction); mLargeScreenShadeHeaderController.setQsExpandedFraction(qsExpansionFraction);
mLargeScreenShadeHeaderController.setQsVisible(mQsVisible); mLargeScreenShadeHeaderController.setQsVisible(mQsVisible);
} }
private float getLockscreenShadeDragProgress() {
// mTransitioningToFullShadeProgress > 0 means we're doing regular lockscreen to shade
// transition. If that's not the case we should follow QS expansion fraction for when
// user is pulling from the same top to go directly to expanded QS
return mTransitioningToFullShadeProgress > 0
? mLockscreenShadeTransitionController.getQSDragProgress()
: computeQsExpansionFraction();
}
private void onStackYChanged(boolean shouldAnimate) { private void onStackYChanged(boolean shouldAnimate) {
if (mQs != null) { if (mQs != null) {
if (shouldAnimate) { if (shouldAnimate) {
@@ -4759,9 +4765,7 @@ public final class NotificationPanelViewController extends PanelViewController {
@Override @Override
public float getLockscreenShadeDragProgress() { public float getLockscreenShadeDragProgress() {
return mTransitioningToFullShadeProgress > 0 return NotificationPanelViewController.this.getLockscreenShadeDragProgress();
? mLockscreenShadeTransitionController.getQSDragProgress()
: computeQsExpansionFraction();
} }
}; };