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

Commit 5bc5eb4c authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Add gravity center to layout params

Also, update string resources on config changes

Test: manually change locale
Fixes: 194642457
Change-Id: I9b7a22db00a57c1a87a6d59472bc7f2ed2c31015
parent 294e8a1e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ 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;
@@ -92,9 +93,12 @@ public class LockIconView extends FrameLayout implements Dumpable {

        setX(mSensorRect.left);
        setY(mSensorRect.top);
        setLayoutParams(new FrameLayout.LayoutParams(

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

    @Override
+8 −2
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
    @NonNull private final AnimatedVectorDrawable mLockToUnlockIcon;
    @NonNull private final Drawable mLockIcon;
    @NonNull private final Drawable mUnlockIcon;
    @NonNull private final CharSequence mUnlockedLabel;
    @NonNull private final CharSequence mLockedLabel;
    @NonNull private CharSequence mUnlockedLabel;
    @NonNull private CharSequence mLockedLabel;
    @Nullable private final Vibrator mVibrator;

    private boolean mIsDozing;
@@ -314,6 +314,12 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
        mHeightPixels = metrics.heightPixels;
        mBottomPadding = mView.getContext().getResources().getDimensionPixelSize(
                R.dimen.lock_icon_margin_bottom);

        mUnlockedLabel = mView.getContext().getResources().getString(
                R.string.accessibility_unlock_button);
        mLockedLabel = mView.getContext()
                .getResources().getString(R.string.accessibility_lock_icon);

        updateLockIconLocation();
    }