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

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

Merge "Remove burn in offset on lock screen." into qt-dev

parents e989ff5c e9aa87b2
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) {