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

Commit 7279a2b9 authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Automerger Merge Worker
Browse files

Merge "Fixing broken shade after unfolding during expanding QS" into udc-dev am: cc0f84d2

parents 1d46aedb cc0f84d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class DebugDrawable extends Drawable {
                Color.YELLOW, "calculatePanelHeightShade()");
        drawDebugInfo(canvas,
                (int) mQsController.calculateNotificationsTopPadding(
                        mNotificationPanelViewController.isExpanding(),
                        mNotificationPanelViewController.isExpandingOrCollapsing(),
                        mNotificationPanelViewController.getKeyguardNotificationStaticPadding(),
                        mNotificationPanelViewController.getExpandedFraction()),
                Color.MAGENTA, "calculateNotificationsTopPadding()");
+20 −14
Original line number Diff line number Diff line
@@ -233,7 +233,6 @@ import javax.inject.Inject;
import javax.inject.Provider;

import kotlin.Unit;

import kotlinx.coroutines.CoroutineDispatcher;

@CentralSurfacesComponent.CentralSurfacesScope
@@ -415,7 +414,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    private final KeyguardClockPositionAlgorithm.Result
            mClockPositionResult =
            new KeyguardClockPositionAlgorithm.Result();
    private boolean mIsExpanding;
    /**
     * Indicates shade (or just QS) is expanding or collapsing but doesn't fully cover KEYGUARD
     * state when shade can be expanded with swipe down or swipe down from the top to full QS.
     */
    private boolean mIsExpandingOrCollapsing;

    /**
     * Indicates drag starting height when swiping down or up on heads-up notifications.
@@ -1862,7 +1865,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

    @Override
    public void expandToNotifications() {
        if (mSplitShadeEnabled && (isShadeFullyExpanded() || isExpanding())) {
        if (mSplitShadeEnabled && (isShadeFullyExpanded() || isExpandingOrCollapsing())) {
            return;
        }
        if (mQsController.getExpanded()) {
@@ -2269,7 +2272,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

    void requestScrollerTopPaddingUpdate(boolean animate) {
        mNotificationStackScrollLayoutController.updateTopPadding(
                mQsController.calculateNotificationsTopPadding(mIsExpanding,
                mQsController.calculateNotificationsTopPadding(mIsExpandingOrCollapsing,
                        getKeyguardNotificationStaticPadding(), mExpandedFraction), animate);
        if (isKeyguardShowing()
                && mKeyguardBypassController.getBypassEnabled()) {
@@ -2322,7 +2325,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        }
        int maxHeight;
        if (mQsController.isExpandImmediate() || mQsController.getExpanded()
                || mIsExpanding && mQsController.getExpandedWhenExpandingStarted()
                || mIsExpandingOrCollapsing && mQsController.getExpandedWhenExpandingStarted()
                || mPulsing || mSplitShadeEnabled) {
            maxHeight = mQsController.calculatePanelHeightExpanded(
                    mClockPositionResult.stackScrollerPadding);
@@ -2342,8 +2345,11 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        return maxHeight;
    }

    public boolean isExpanding() {
        return mIsExpanding;
    @Override
    public boolean isExpandingOrCollapsing() {
        float lockscreenExpansionProgress = mQsController.getLockscreenShadeDragProgress();
        return mIsExpandingOrCollapsing
                || (0 < lockscreenExpansionProgress && lockscreenExpansionProgress < 1);
    }

    private void onHeightUpdated(float expandedHeight) {
@@ -2355,7 +2361,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                    mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx);
        }
        if (!mQsController.getExpanded() || mQsController.isExpandImmediate()
                || mIsExpanding && mQsController.getExpandedWhenExpandingStarted()) {
                || mIsExpandingOrCollapsing && mQsController.getExpandedWhenExpandingStarted()) {
            // Updating the clock position will set the top padding which might
            // trigger a new panel height and re-position the clock.
            // This is a circular dependency and should be avoided, otherwise we'll have
@@ -2493,7 +2499,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        mNotificationStackScrollLayoutController.onExpansionStopped();
        mHeadsUpManager.onExpandingFinished();
        mConversationNotificationManager.onNotificationPanelExpandStateChanged(isFullyCollapsed());
        mIsExpanding = false;
        mIsExpandingOrCollapsing = false;
        mMediaHierarchyManager.setCollapsingShadeFromQS(false);
        mMediaHierarchyManager.setQsExpanded(mQsController.getExpanded());
        if (isFullyCollapsed()) {
@@ -3199,7 +3205,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        ipw.print("mDisplayTopInset="); ipw.println(mDisplayTopInset);
        ipw.print("mDisplayRightInset="); ipw.println(mDisplayRightInset);
        ipw.print("mDisplayLeftInset="); ipw.println(mDisplayLeftInset);
        ipw.print("mIsExpanding="); ipw.println(mIsExpanding);
        ipw.print("mIsExpandingOrCollapsing="); ipw.println(mIsExpandingOrCollapsing);
        ipw.print("mHeadsUpStartHeight="); ipw.println(mHeadsUpStartHeight);
        ipw.print("mListenForHeadsUp="); ipw.println(mListenForHeadsUp);
        ipw.print("mNavigationBarBottomHeight="); ipw.println(mNavigationBarBottomHeight);
@@ -3431,7 +3437,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    void notifyExpandingStarted() {
        if (!mExpanding) {
            mExpanding = true;
            mIsExpanding = true;
            mIsExpandingOrCollapsing = true;
            mQsController.onExpandingStarted(mQsController.getFullyExpanded());
        }
    }
@@ -3792,7 +3798,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
        } else if (mBarState == SHADE_LOCKED) {
            return true;
        } else {
            // case of two finger swipe from the top of keyguard
            // case of swipe from the top of keyguard to expanded QS
            return mQsController.computeExpansionFraction() == 1;
        }
    }
@@ -4044,7 +4050,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
     * shade QS are always expanded
     */
    private void closeQsIfPossible() {
        boolean openOrOpening = isShadeFullyExpanded() || isExpanding();
        boolean openOrOpening = isShadeFullyExpanded() || isExpandingOrCollapsing();
        if (!(mSplitShadeEnabled && openOrOpening)) {
            mQsController.closeQs();
        }
@@ -4767,7 +4773,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump

            // If pulse is expanding already, let's give it the touch. There are situations
            // where the panel starts expanding even though we're also pulsing
            boolean pulseShouldGetTouch = (!mIsExpanding
            boolean pulseShouldGetTouch = (!mIsExpandingOrCollapsing
                    && !mQsController.shouldQuickSettingsIntercept(mDownX, mDownY, 0))
                    || mPulseExpansionHandler.isExpanding();
            if (pulseShouldGetTouch && mPulseExpansionHandler.onTouchEvent(event)) {
+5 −0
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@ public interface ShadeController {
     */
    boolean isShadeFullyOpen();

    /**
     * Returns whether shade or QS are currently opening or collapsing.
     */
    boolean isExpandingOrCollapsing();

    /**
     * Add a runnable for NotificationPanelView to post when the panel is expanded.
     *
+5 −0
Original line number Diff line number Diff line
@@ -163,6 +163,11 @@ public final class ShadeControllerImpl implements ShadeController {
        return mNotificationPanelViewController.isShadeFullyExpanded();
    }

    @Override
    public boolean isExpandingOrCollapsing() {
        return mNotificationPanelViewController.isExpandingOrCollapsing();
    }

    @Override
    public void postOnShadeExpanded(Runnable executable) {
        mNotificationPanelViewController.addOnGlobalLayoutListener(
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ interface ShadeViewController {
    fun expandToNotifications()

    /** Returns whether the shade is expanding or collapsing itself or quick settings. */
    val isExpanding: Boolean
    val isExpandingOrCollapsing: Boolean

    /**
     * Returns whether the shade height is greater than zero (i.e. partially or fully expanded),
Loading