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

Commit f699110e authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "Use layout parameters to determine lock icon location" into sc-dev am:...

Merge "Use layout parameters to determine lock icon location" into sc-dev am: d20a486d am: d188dc34 am: b2e53ed4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15482397

Change-Id: Ie63f73ab73563391083c3b0b7593a3a4e0a95c9a
parents ae847696 b2e53ed4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -54,8 +54,7 @@
    <com.android.keyguard.LockIconView
        android:id="@+id/lock_icon_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center">
        android:layout_height="wrap_content">
        <!-- Background protection -->
        <ImageView
            android:id="@+id/lock_icon_bg"
+6 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -91,13 +90,11 @@ public class LockIconView extends FrameLayout implements Dumpable {
                mLockIconCenter.x + mRadius,
                mLockIconCenter.y + mRadius);

        setX(mSensorRect.left);
        setY(mSensorRect.top);

        final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
                (int) (mSensorRect.right - mSensorRect.left),
                (int) (mSensorRect.bottom - mSensorRect.top));
        lp.gravity = Gravity.CENTER;
        final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams();
        lp.width = (int) (mSensorRect.right - mSensorRect.left);
        lp.height = (int) (mSensorRect.bottom - mSensorRect.top);
        lp.topMargin = (int) mSensorRect.top;
        lp.setMarginStart((int) mSensorRect.left);
        setLayoutParams(lp);
    }

@@ -114,5 +111,6 @@ public class LockIconView extends FrameLayout implements Dumpable {
    public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
        pw.println("Center in px (x, y)= (" + mLockIconCenter.x + ", " + mLockIconCenter.y + ")");
        pw.println("Radius in pixels: " + mRadius);
        pw.println("topLeft= (" + getX() + ", " + getY() + ")");
    }
}