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

Commit 79087bc7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fade in quick settings when shade opens"

parents dfb11c4d 0e50fa68
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.qs.QSPanel.QSTileLayout;
import com.android.systemui.qs.TouchAnimator.Builder;
import com.android.systemui.qs.TouchAnimator.Listener;
import com.android.systemui.qs.dagger.QSScope;
import com.android.systemui.statusbar.CrossFadeHelper;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;

@@ -49,7 +50,9 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    private static final String MOVE_FULL_ROWS = "sysui_qs_move_whole_rows";

    public static final float EXPANDED_TILE_DELAY = .86f;

    private static final long QQS_FADE_IN_DURATION = 200L;
    // Fade out faster than fade in to finish before QQS hides.
    private static final long QQS_FADE_OUT_DURATION = 50L;

    private final ArrayList<View> mAllViews = new ArrayList<>();
    /**
@@ -77,6 +80,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
    private TouchAnimator mBrightnessAnimator;
    private boolean mNeedsAnimatorUpdate = false;

    private boolean mToShowing;
    private boolean mOnKeyguard;

    private boolean mAllowFancy;
@@ -133,6 +137,18 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha
        }
    }

    void startAlphaAnimation(boolean show) {
        if (show == mToShowing) {
            return;
        }
        mToShowing = show;
        if (show) {
            CrossFadeHelper.fadeIn(mQs.getView(), QQS_FADE_IN_DURATION, 0 /* delay */);
        } else {
            CrossFadeHelper.fadeOut(mQs.getView(), QQS_FADE_OUT_DURATION, 0 /* delay */,
                    null /* endRunnable */);
        }
    }

    /**
     * Sets whether or not the keyguard is currently being shown with a collapsed header.
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ public class QSContainerImpl extends FrameLayout {
        setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
    }

    void onMediaVisibilityChanged(boolean qsVisible) {
        mAnimateBottomOnNextLayout = qsVisible;
    }
+4 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
                (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
                    boolean sizeChanged = (oldTop - oldBottom) != (top - bottom);
                    if (sizeChanged) {
                        setQsExpansion(mLastQSExpansion, mLastQSExpansion);
                        setQsExpansion(mLastQSExpansion, mLastHeaderTranslation);
                    }
                });
    }
@@ -391,6 +391,9 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    @Override
    public void setQsExpansion(float expansion, float headerTranslation) {
        if (DEBUG) Log.d(TAG, "setQSExpansion " + expansion + " " + headerTranslation);
        if (mQSAnimator != null) {
            mQSAnimator.startAlphaAnimation(headerTranslation == 0 /* show */);
        }
        mContainer.setExpansion(expansion);
        final float translationScaleY = expansion - 1;
        boolean onKeyguardAndExpanded = isKeyguardShowing() && !mShowCollapsedOnKeyguard;