Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4dd50bf authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Fixing reading shade expansion progress when user pulls from the top of lockscreen

This is special case not covered by shade to lockscreen transition (LockscreenShadeTransitionController) as here shade goes directly to expanded QS and we should use QS expansion fraction to properly track the progress.

Bug: 244574445
Test: Go to large screen portrait lockscreen, pull down from the top, QS status bar should slowly fade in
Change-Id: Ic74fb42e48b2aa3da956c47c41205058175e5273
parent 4e528edd
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -2479,17 +2479,23 @@ public final class NotificationPanelViewController extends PanelViewController {
        mDepthController.setQsPanelExpansion(qsExpansionFraction);
        mStatusBarKeyguardViewManager.setQsExpansion(qsExpansionFraction);

        // updateQsExpansion will get called whenever mTransitionToFullShadeProgress or
        // mLockscreenShadeTransitionController.getDragProgress change.
        // When in lockscreen, getDragProgress indicates the true expanded fraction of QS
        float shadeExpandedFraction = mTransitioningToFullShadeProgress > 0
                ? mLockscreenShadeTransitionController.getQSDragProgress()
        float shadeExpandedFraction = isOnKeyguard()
                ? getLockscreenShadeDragProgress()
                : getExpandedFraction();
        mLargeScreenShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction);
        mLargeScreenShadeHeaderController.setQsExpandedFraction(qsExpansionFraction);
        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) {
        if (mQs != null) {
            if (shouldAnimate) {
@@ -4749,9 +4755,7 @@ public final class NotificationPanelViewController extends PanelViewController {

                @Override
                public float getLockscreenShadeDragProgress() {
                    return mTransitioningToFullShadeProgress > 0
                            ? mLockscreenShadeTransitionController.getQSDragProgress()
                            : computeQsExpansionFraction();
                    return NotificationPanelViewController.this.getLockscreenShadeDragProgress();
                }
            };