From f3a7691c1ccf2031d9d7a68911a3b997f648c849 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Wed, 27 Jan 2021 14:32:14 -0500 Subject: [PATCH] PIN Bouncer: Fix margins Margins were being added, but not always processed in time for layout. Apply margins earlier. Fixes: 178359464 Test: manual Change-Id: I4f4a77abd36c529000ccca58887b02a852640275 --- .../SystemUI/src/com/android/keyguard/NumPadKey.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java index 8ebcb20fe63f3..756d6107570af 100644 --- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java +++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java @@ -156,9 +156,14 @@ public class NumPadKey extends ViewGroup { } @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - mAnimator.updateMargin((ViewGroup.MarginLayoutParams) getLayoutParams()); + public void setLayoutParams(ViewGroup.LayoutParams params) { + mAnimator.updateMargin((ViewGroup.MarginLayoutParams) params); + super.setLayoutParams(params); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); measureChildren(widthMeasureSpec, heightMeasureSpec);