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

Commit 8e0ae7a8 authored by Robert Snoeberger's avatar Robert Snoeberger Committed by android-build-merger
Browse files

Merge "Remove burn in offset on lock screen." into qt-dev am: 03b349a1

am: e7e04c96

Change-Id: I3f25164f60043784ba18a383f28ce89fee3a02bb
parents d096ded9 e7e04c96
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ public class AnalogClockController implements ClockPlugin {
    @Override
    public void setDarkAmount(float darkAmount) {
        mClockPosition.setDarkAmount(darkAmount);
        mBigClockView.setDarkAmount(darkAmount);
    }

    @Override
+1 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ public class BubbleClockController implements ClockPlugin {
    @Override
    public void setDarkAmount(float darkAmount) {
        mClockPosition.setDarkAmount(darkAmount);
        mView.setDarkAmount(darkAmount);
    }

    @Override
+17 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.util.MathUtils;
import android.view.View;
import android.widget.FrameLayout;

@@ -43,6 +44,8 @@ public class ClockLayout extends FrameLayout {
    private int mBurnInPreventionOffsetX;
    private int mBurnInPreventionOffsetY;

    private float mDarkAmount;

    public ClockLayout(Context context) {
        this(context, null);
    }
@@ -78,11 +81,21 @@ public class ClockLayout extends FrameLayout {
        positionChildren();
    }

    /**
     * See {@link com.android.systemui.plugins.ClockPlugin#setDarkAmount(float)}.
     */
    void setDarkAmount(float darkAmount) {
        mDarkAmount = darkAmount;
        positionChildren();
    }

    private void positionChildren() {
        final float offsetX = getBurnInOffset(mBurnInPreventionOffsetX * 2, true)
                - mBurnInPreventionOffsetX;
        final float offsetY = getBurnInOffset(mBurnInPreventionOffsetY * 2, false)
                - mBurnInPreventionOffsetY;
        final float offsetX = MathUtils.lerp(0f,
                getBurnInOffset(mBurnInPreventionOffsetX * 2, true) - mBurnInPreventionOffsetX,
                mDarkAmount);
        final float offsetY = MathUtils.lerp(0f,
                getBurnInOffset(mBurnInPreventionOffsetY * 2, false) - mBurnInPreventionOffsetY,
                mDarkAmount);

        // Put the analog clock in the middle of the screen.
        if (mAnalogClock != null) {