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

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

Merge "Fix AOD scrim excluded area"

parents 957fe1e7 8e9fa2da
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -366,7 +366,7 @@ public class NotificationStackScrollLayout extends ViewGroup
    private boolean mGroupExpandedForMeasure;
    private boolean mScrollable;
    private View mForcedScroll;
    private float mDarkAmount = 1.0f;
    private float mDarkAmount = 0f;
    private static final Property<NotificationStackScrollLayout, Float> DARK_AMOUNT =
            new FloatProperty<NotificationStackScrollLayout>("darkAmount") {
                @Override
@@ -524,9 +524,9 @@ public class NotificationStackScrollLayout extends ViewGroup
            setClipBounds(null);
        } else {
            float animProgress = Interpolators.FAST_OUT_SLOW_IN
                    .getInterpolation(mDarkAmount);
                    .getInterpolation(1f - mDarkAmount);
            float sidePaddingsProgress = Interpolators.FAST_OUT_SLOW_IN
                    .getInterpolation(mDarkAmount * 2);
                    .getInterpolation((1f - mDarkAmount) * 2);
            mTmpRect.set((int) MathUtils.lerp(darkLeft, lockScreenLeft, sidePaddingsProgress),
                    (int) MathUtils.lerp(darkTop, lockScreenTop, animProgress),
                    (int) MathUtils.lerp(darkRight, lockScreenRight, sidePaddingsProgress),
@@ -549,7 +549,7 @@ public class NotificationStackScrollLayout extends ViewGroup
        } else {
            float alpha =
                    BACKGROUND_ALPHA_DIMMED + (1 - BACKGROUND_ALPHA_DIMMED) * (1.0f - mDimAmount);
            alpha *= mDarkAmount;
            alpha *= 1f - mDarkAmount;
            // We need to manually blend in the background color
            int scrimColor = mScrimController.getBackgroundColor();
            color = ColorUtils.blendARGB(scrimColor, mBgColor, alpha);
@@ -2326,8 +2326,9 @@ public class NotificationStackScrollLayout extends ViewGroup
            return;
        }

        final boolean awake = mDarkAmount != 0 || mAmbientState.isDark();
        mScrimController.setExcludedBackgroundArea(
                mFadingOut || mParentNotFullyVisible || mDarkAmount != 1 || mIsClipped ? null
                mFadingOut || mParentNotFullyVisible || awake || mIsClipped ? null
                        : mCurrentBounds);
        invalidate();
    }
@@ -3880,17 +3881,12 @@ public class NotificationStackScrollLayout extends ViewGroup
            mDarkNeedsAnimation = true;
            mDarkAnimationOriginIndex = findDarkAnimationOriginIndex(touchWakeUpScreenLocation);
            mNeedsAnimation =  true;
            setDarkAmount(0.0f);
        } else if (!dark) {
            setDarkAmount(1.0f);
        }
        requestChildrenUpdate();
        if (dark) {
            mScrimController.setExcludedBackgroundArea(null);
        } else {
            setDarkAmount(dark ? 1f : 0f);
            updateBackground();
        }

        requestChildrenUpdate();
        applyCurrentBackgroundBounds();
        updateWillNotDraw();
        updateContentHeight();
        notifyHeightChangeListener(mShelf);
@@ -3916,7 +3912,7 @@ public class NotificationStackScrollLayout extends ViewGroup
    }

    private void startBackgroundFadeIn() {
        ObjectAnimator fadeAnimator = ObjectAnimator.ofFloat(this, DARK_AMOUNT, 0f, 1f);
        ObjectAnimator fadeAnimator = ObjectAnimator.ofFloat(this, DARK_AMOUNT, mDarkAmount, 0f);
        fadeAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_WAKEUP);
        fadeAnimator.setInterpolator(Interpolators.ALPHA_IN);
        fadeAnimator.start();