diff options
author | Matt Lee <matthewhlee@google.com> | 2022-06-12 23:19:47 +0000 |
---|---|---|
committer | Matt Lee <matthewhlee@google.com> | 2022-06-12 23:19:47 +0000 |
commit | 2ee3b28251c8f6864a6dbcd229b7a1641a4782e4 (patch) | |
tree | 3577b78cd7727ed3695b831753db86a62462ed7b /packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java | |
parent | 64c414abd49acc8d488837ab90b51d822c23e66d (diff) |
Revert "Merge s-mpr-2022-06"
Revert submission 732792
Reason for revert: build failure
Reverted Changes:
I3cbe7c924:Merge s-mpr-2022-06
I9881453ba:Don't set background color if TDA doesn't have a v...
I57fa88c6f:Use TDA for background color instead of new color ...
Ic2fa89b76:Dialing phone state should update active sub
Change-Id: I9709841558bfcb325f7e205f5f5ec89c620d14dd
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java index 5b4f7a21f8d0..1efda7edee2f 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java @@ -21,13 +21,10 @@ import static com.android.systemui.statusbar.policy.DevicePostureController.DEVI import android.content.Context; import android.content.res.Configuration; -import android.content.res.Resources; import android.util.AttributeSet; import android.view.View; -import android.view.ViewGroup; import android.view.animation.AnimationUtils; -import androidx.constraintlayout.helper.widget.Flow; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; @@ -90,45 +87,48 @@ public class KeyguardPINView extends KeyguardPinBasedInputView { } private void updateMargins() { - Resources res = mContext.getResources(); - // Re-apply everything to the keys... - int verticalMargin = res.getDimensionPixelSize(R.dimen.num_pad_entry_row_margin_bottom); - int horizontalMargin = res.getDimensionPixelSize(R.dimen.num_pad_key_margin_end); - String ratio = res.getString(R.string.num_pad_key_ratio); - - Flow flow = (Flow) mContainer.findViewById(R.id.flow1); - flow.setHorizontalGap(horizontalMargin); - flow.setVerticalGap(verticalMargin); + int bottomMargin = mContext.getResources().getDimensionPixelSize( + R.dimen.num_pad_entry_row_margin_bottom); + int rightMargin = mContext.getResources().getDimensionPixelSize( + R.dimen.num_pad_key_margin_end); + String ratio = mContext.getResources().getString(R.string.num_pad_key_ratio); + + // mView contains all Views that make up the PIN pad; row0 = the entry test field, then + // rows 1-4 contain the buttons. Iterate over all views that make up the buttons in the pad, + // and re-set all the margins. + for (int row = 1; row < 5; row++) { + for (int column = 0; column < 3; column++) { + View key = mViews[row][column]; + + ConstraintLayout.LayoutParams lp = + (ConstraintLayout.LayoutParams) key.getLayoutParams(); + + lp.dimensionRatio = ratio; + + // Don't set any margins on the last row of buttons. + if (row != 4) { + lp.bottomMargin = bottomMargin; + } + + // Don't set margins on the rightmost buttons. + if (column != 2) { + lp.rightMargin = rightMargin; + } + + key.setLayoutParams(lp); + } + } // Update the guideline based on the device posture... - float halfOpenPercentage = res.getFloat(R.dimen.half_opened_bouncer_height_ratio); + float halfOpenPercentage = + mContext.getResources().getFloat(R.dimen.half_opened_bouncer_height_ratio); ConstraintSet cs = new ConstraintSet(); cs.clone(mContainer); cs.setGuidelinePercent(R.id.pin_pad_top_guideline, mLastDevicePosture == DEVICE_POSTURE_HALF_OPENED ? halfOpenPercentage : 0.0f); cs.applyTo(mContainer); - - // Password entry area - int passwordHeight = res.getDimensionPixelSize(R.dimen.keyguard_password_height); - View pinEntry = findViewById(getPasswordTextViewId()); - ViewGroup.LayoutParams lp = pinEntry.getLayoutParams(); - lp.height = passwordHeight; - pinEntry.setLayoutParams(lp); - - // Below row0 - View row0 = findViewById(R.id.row0); - row0.setPadding(0, 0, 0, verticalMargin); - - // Above the emergency contact area - int marginTop = res.getDimensionPixelSize(R.dimen.keyguard_eca_top_margin); - View eca = findViewById(R.id.keyguard_selector_fade_container); - if (eca != null) { - ViewGroup.MarginLayoutParams mLp = (ViewGroup.MarginLayoutParams) eca.getLayoutParams(); - mLp.topMargin = marginTop; - eca.setLayoutParams(mLp); - } } @Override |