diff options
| author | 2021-07-30 00:48:58 +0000 | |
|---|---|---|
| committer | 2021-07-30 00:48:58 +0000 | |
| commit | a1089252cd2169f926ef429168727bee8a6318eb (patch) | |
| tree | 311ca86e5827639092029718db7dc1106e7d4071 | |
| parent | 8f8facbbbcec60b06834f82ea6f1bc2cdd4b8469 (diff) | |
| parent | 98a49679089ee5c348c60cf958cdc1c614021aae (diff) | |
Merge "Add gravity center to layout params" into sc-dev am: 98a4967908
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15411507
Change-Id: I3b0609ebfa57aae1e02078331cbf5e2b43a3154f
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/LockIconView.java | 8 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/LockIconViewController.java | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java index 42777ffcc9cf..622419a86bfc 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java @@ -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 diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 9beb4cce0ca7..4317e258d8f7 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -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(); } |