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

Commit 294f8c51 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Always have QS expanded on split shade

Test: pull down qs from launcher, lock screen, from regular or split
      shade modes.
Test: repeat tests pulling down with 2 fingers
Fixes: 204450723
Change-Id: Ifea32b10378ed4cc240ea1a95bea12db515479bf
Merged-In: Ifea32b10378ed4cc240ea1a95bea12db515479bf
parent 14adaaa3
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -109,6 +109,16 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
        mPageToRestore = savedInstanceState.getInt(CURRENT_PAGE, -1);
        mPageToRestore = savedInstanceState.getInt(CURRENT_PAGE, -1);
    }
    }


    @Override
    public int getTilesHeight() {
        // Use the first page as that is the maximum height we need to show.
        TileLayout tileLayout = mPages.get(0);
        if (tileLayout == null) {
            return 0;
        }
        return tileLayout.getTilesHeight();
    }

    @Override
    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        super.onConfigurationChanged(newConfig);
+14 −9
Original line number Original line Diff line number Diff line
@@ -377,23 +377,24 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    }
    }


    private void updateQsState() {
    private void updateQsState() {
        final boolean expandVisually = mQsExpanded || mStackScrollerOverscrolling
        final boolean expanded = mQsExpanded || mInSplitShade;
        final boolean expandVisually = expanded || mStackScrollerOverscrolling
                || mHeaderAnimating;
                || mHeaderAnimating;
        mQSPanelController.setExpanded(mQsExpanded);
        mQSPanelController.setExpanded(expanded);
        mQSDetail.setExpanded(mQsExpanded);
        mQSDetail.setExpanded(expanded);
        boolean keyguardShowing = isKeyguardState();
        boolean keyguardShowing = isKeyguardState();
        mHeader.setVisibility((mQsExpanded || !keyguardShowing || mHeaderAnimating
        mHeader.setVisibility((expanded || !keyguardShowing || mHeaderAnimating
                || mShowCollapsedOnKeyguard)
                || mShowCollapsedOnKeyguard)
                ? View.VISIBLE
                ? View.VISIBLE
                : View.INVISIBLE);
                : View.INVISIBLE);
        mHeader.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
        mHeader.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
                || (mQsExpanded && !mStackScrollerOverscrolling), mQuickQSPanelController);
                || (expanded && !mStackScrollerOverscrolling), mQuickQSPanelController);
        mFooter.setVisibility(!mQsDisabled && (mQsExpanded || !keyguardShowing || mHeaderAnimating
        mFooter.setVisibility(!mQsDisabled && (expanded || !keyguardShowing || mHeaderAnimating
                || mShowCollapsedOnKeyguard)
                || mShowCollapsedOnKeyguard)
                ? View.VISIBLE
                ? View.VISIBLE
                : View.INVISIBLE);
                : View.INVISIBLE);
        mFooter.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
        mFooter.setExpanded((keyguardShowing && !mHeaderAnimating && !mShowCollapsedOnKeyguard)
                || (mQsExpanded && !mStackScrollerOverscrolling));
                || (expanded && !mStackScrollerOverscrolling));
        mQSPanelController.setVisibility(
        mQSPanelController.setVisibility(
                !mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
                !mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
    }
    }
@@ -405,7 +406,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    }
    }


    private void updateShowCollapsedOnKeyguard() {
    private void updateShowCollapsedOnKeyguard() {
        boolean showCollapsed = mBypassController.getBypassEnabled() || mTransitioningToFullShade;
        boolean showCollapsed = mBypassController.getBypassEnabled()
                || (mTransitioningToFullShade && !mInSplitShade);
        if (showCollapsed != mShowCollapsedOnKeyguard) {
        if (showCollapsed != mShowCollapsedOnKeyguard) {
            mShowCollapsedOnKeyguard = showCollapsed;
            mShowCollapsedOnKeyguard = showCollapsed;
            updateQsState();
            updateQsState();
@@ -485,6 +487,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    public void setInSplitShade(boolean inSplitShade) {
    public void setInSplitShade(boolean inSplitShade) {
        mInSplitShade = inSplitShade;
        mInSplitShade = inSplitShade;
        mQSAnimator.setTranslateWhileExpanding(inSplitShade);
        mQSAnimator.setTranslateWhileExpanding(inSplitShade);
        updateShowCollapsedOnKeyguard();
        updateQsState();
    }
    }


    @Override
    @Override
@@ -503,7 +507,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    public void setQsExpansion(float expansion, float panelExpansionFraction,
    public void setQsExpansion(float expansion, float panelExpansionFraction,
            float proposedTranslation, float squishinessFraction) {
            float proposedTranslation, float squishinessFraction) {
        float headerTranslation = mTransitioningToFullShade ? 0 : proposedTranslation;
        float headerTranslation = mTransitioningToFullShade ? 0 : proposedTranslation;
        float progress = mTransitioningToFullShade ? mFullShadeProgress : panelExpansionFraction;
        float progress = mTransitioningToFullShade || mState == StatusBarState.KEYGUARD
                ? mFullShadeProgress : panelExpansionFraction;
        setAlphaAnimationProgress(mInSplitShade ? progress : 1);
        setAlphaAnimationProgress(mInSplitShade ? progress : 1);
        mContainer.setExpansion(expansion);
        mContainer.setExpansion(expansion);
        final float translationScaleY = (mInSplitShade
        final float translationScaleY = (mInSplitShade
+7 −6
Original line number Original line Diff line number Diff line
@@ -258,13 +258,8 @@ public class QSPanel extends LinearLayout implements Tunable {
    }
    }


    private void updateViewPositions() {
    private void updateViewPositions() {
        if (!(mTileLayout instanceof TileLayout)) {
            return;
        }
        TileLayout layout = (TileLayout) mTileLayout;

        // Adjust view positions based on tile squishing
        // Adjust view positions based on tile squishing
        int tileHeightOffset = layout.getTilesHeight() - layout.getHeight();
        int tileHeightOffset = mTileLayout.getTilesHeight() - mTileLayout.getHeight();


        boolean move = false;
        boolean move = false;
        for (int i = 0; i < getChildCount(); i++) {
        for (int i = 0; i < getChildCount(); i++) {
@@ -787,6 +782,12 @@ public class QSPanel extends LinearLayout implements Tunable {
        /** */
        /** */
        void setListening(boolean listening, UiEventLogger uiEventLogger);
        void setListening(boolean listening, UiEventLogger uiEventLogger);


        /** */
        int getHeight();

        /** */
        int getTilesHeight();

        /**
        /**
         * Sets a size modifier for the tile. Where 0 means collapsed, and 1 expanded.
         * Sets a size modifier for the tile. Where 0 means collapsed, and 1 expanded.
         */
         */
+1 −0
Original line number Original line Diff line number Diff line
@@ -275,6 +275,7 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
        return Math.max(mColumns * mRows, 1);
        return Math.max(mColumns * mRows, 1);
    }
    }


    @Override
    public int getTilesHeight() {
    public int getTilesHeight() {
        return mLastTileBottom + getPaddingBottom();
        return mLastTileBottom + getPaddingBottom();
    }
    }
+2 −2
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ class LockscreenShadeTransitionController @Inject constructor(
    internal fun canDragDown(): Boolean {
    internal fun canDragDown(): Boolean {
        return (statusBarStateController.state == StatusBarState.KEYGUARD ||
        return (statusBarStateController.state == StatusBarState.KEYGUARD ||
                nsslController.isInLockedDownShade()) &&
                nsslController.isInLockedDownShade()) &&
                qS.isFullyCollapsed
                (qS.isFullyCollapsed || useSplitShade)
    }
    }


    /**
    /**
@@ -285,7 +285,7 @@ class LockscreenShadeTransitionController @Inject constructor(
    internal val isDragDownAnywhereEnabled: Boolean
    internal val isDragDownAnywhereEnabled: Boolean
        get() = (statusBarStateController.getState() == StatusBarState.KEYGUARD &&
        get() = (statusBarStateController.getState() == StatusBarState.KEYGUARD &&
                !keyguardBypassController.bypassEnabled &&
                !keyguardBypassController.bypassEnabled &&
                qS.isFullyCollapsed)
                (qS.isFullyCollapsed || useSplitShade))


    /**
    /**
     * The amount in pixels that the user has dragged down.
     * The amount in pixels that the user has dragged down.
Loading