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

Commit 9c411972 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Always have QS expanded on split shade"

parents 79969521 f2083110
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -112,6 +112,15 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
        mPageToRestore = savedInstanceState.getInt(CURRENT_PAGE, -1);
    }

    @Override
    public int getTilesHeight() {
        TileLayout tileLayout = mPages.get(getCurrentItem());
        if (tileLayout == null) {
            return 0;
        }
        return tileLayout.getTilesHeight();
    }

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

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

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

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

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

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

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

        /** */
        int getHeight();

        /** */
        int getTilesHeight();

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

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

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

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