Merge "Updated keyguard_pin_view to use a ConstraintLayout." into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a8813c12da
@@ -20,171 +20,166 @@
|
|||||||
<com.android.keyguard.KeyguardPINView
|
<com.android.keyguard.KeyguardPINView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:androidprv="http://schemas.android.com/apk/res-auto"
|
xmlns:androidprv="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/keyguard_pin_view"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/keyguard_pin_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
androidprv:layout_maxWidth="@dimen/keyguard_security_width"
|
androidprv:layout_maxWidth="@dimen/keyguard_security_width"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/pin_container"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/pin_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layoutDirection="ltr"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- Set this to be just above key1. It would be better to introduce a barrier above
|
||||||
|
key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
|
||||||
|
drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
|
||||||
|
case, the Flow should ensure that key1/2/3 all have the same top, so this should be
|
||||||
|
fine. -->
|
||||||
|
<com.android.keyguard.AlphaOptimizedRelativeLayout
|
||||||
|
android:id="@+id/row0"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
|
||||||
android:layout_weight="1"
|
androidprv:layout_constraintBottom_toTopOf="@id/key1"
|
||||||
android:layoutDirection="ltr"
|
androidprv:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginBottom="8dp"
|
androidprv:layout_constraintStart_toStartOf="parent"
|
||||||
>
|
|
||||||
<Space
|
androidprv:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_width="match_parent"
|
androidprv:layout_constraintVertical_bias="1.0">
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<com.android.keyguard.AlphaOptimizedRelativeLayout
|
|
||||||
android:id="@+id/row0"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
|
|
||||||
>
|
|
||||||
<com.android.keyguard.PasswordTextView
|
<com.android.keyguard.PasswordTextView
|
||||||
android:id="@+id/pinEntry"
|
android:id="@+id/pinEntry"
|
||||||
android:layout_width="@dimen/keyguard_security_width"
|
style="@style/Widget.TextView.Password"
|
||||||
android:layout_height="@dimen/keyguard_password_height"
|
android:layout_width="@dimen/keyguard_security_width"
|
||||||
style="@style/Widget.TextView.Password"
|
android:layout_height="@dimen/keyguard_password_height"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginRight="72dp"
|
android:layout_marginRight="72dp"
|
||||||
androidprv:scaledTextSize="@integer/scaled_password_text_size"
|
android:contentDescription="@string/keyguard_accessibility_pin_area"
|
||||||
android:contentDescription="@string/keyguard_accessibility_pin_area"
|
androidprv:scaledTextSize="@integer/scaled_password_text_size" />
|
||||||
/>
|
|
||||||
</com.android.keyguard.AlphaOptimizedRelativeLayout>
|
</com.android.keyguard.AlphaOptimizedRelativeLayout>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/row1"
|
<androidx.constraintlayout.helper.widget.Flow
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/flow1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:orientation="horizontal"
|
android:layout_height="0dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
|
|
||||||
>
|
androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
|
||||||
<com.android.keyguard.NumPadKey
|
|
||||||
android:id="@+id/key1"
|
androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
|
||||||
android:layout_height="match_parent"
|
androidprv:flow_horizontalStyle="packed"
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
androidprv:flow_maxElementsWrap="3"
|
||||||
androidprv:textView="@+id/pinEntry"
|
|
||||||
androidprv:digit="1"
|
androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
|
||||||
/>
|
androidprv:flow_verticalStyle="packed"
|
||||||
<com.android.keyguard.NumPadKey
|
androidprv:flow_verticalBias="1.0"
|
||||||
android:id="@+id/key2"
|
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
androidprv:flow_wrapMode="aligned"
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
androidprv:layout_constraintTop_toTopOf="parent"
|
||||||
androidprv:textView="@+id/pinEntry"
|
androidprv:layout_constraintBottom_toBottomOf="parent"
|
||||||
androidprv:digit="2"
|
androidprv:layout_constraintEnd_toEndOf="parent"
|
||||||
/>
|
androidprv:layout_constraintStart_toStartOf="parent" />
|
||||||
<com.android.keyguard.NumPadKey
|
|
||||||
android:id="@+id/key3"
|
<com.android.keyguard.NumPadKey
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
android:id="@+id/key1"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
androidprv:textView="@+id/pinEntry"
|
android:layout_height="0dp"
|
||||||
androidprv:digit="3"
|
androidprv:digit="1"
|
||||||
/>
|
androidprv:textView="@+id/pinEntry" />
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
<com.android.keyguard.NumPadKey
|
||||||
android:id="@+id/row2"
|
android:id="@+id/key2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:orientation="horizontal"
|
androidprv:digit="2"
|
||||||
android:layout_gravity="center_horizontal"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
|
|
||||||
>
|
<com.android.keyguard.NumPadKey
|
||||||
<com.android.keyguard.NumPadKey
|
android:id="@+id/key3"
|
||||||
android:id="@+id/key4"
|
android:layout_width="0dp"
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
android:layout_height="0dp"
|
||||||
android:layout_height="match_parent"
|
androidprv:digit="3"
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
androidprv:textView="@+id/pinEntry"
|
|
||||||
androidprv:digit="4"
|
<com.android.keyguard.NumPadKey
|
||||||
/>
|
android:id="@+id/key4"
|
||||||
<com.android.keyguard.NumPadKey
|
android:layout_width="0dp"
|
||||||
android:id="@+id/key5"
|
android:layout_height="0dp"
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
androidprv:digit="4"
|
||||||
android:layout_height="match_parent"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
|
||||||
androidprv:textView="@+id/pinEntry"
|
<com.android.keyguard.NumPadKey
|
||||||
androidprv:digit="5"
|
android:id="@+id/key5"
|
||||||
/>
|
android:layout_width="0dp"
|
||||||
<com.android.keyguard.NumPadKey
|
android:layout_height="0dp"
|
||||||
android:id="@+id/key6"
|
androidprv:digit="5"
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
android:layout_height="match_parent"
|
|
||||||
androidprv:textView="@+id/pinEntry"
|
<com.android.keyguard.NumPadKey
|
||||||
androidprv:digit="6"
|
android:id="@+id/key6"
|
||||||
/>
|
android:layout_width="0dp"
|
||||||
</LinearLayout>
|
android:layout_height="0dp"
|
||||||
<LinearLayout
|
androidprv:digit="6"
|
||||||
android:id="@+id/row3"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
<com.android.keyguard.NumPadKey
|
||||||
android:orientation="horizontal"
|
android:id="@+id/key7"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_width="0dp"
|
||||||
android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
|
android:layout_height="0dp"
|
||||||
>
|
androidprv:digit="7"
|
||||||
<com.android.keyguard.NumPadKey
|
androidprv:textView="@+id/pinEntry" />
|
||||||
android:id="@+id/key7"
|
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
<com.android.keyguard.NumPadKey
|
||||||
android:layout_height="match_parent"
|
android:id="@+id/key8"
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
android:layout_width="0dp"
|
||||||
androidprv:textView="@+id/pinEntry"
|
android:layout_height="0dp"
|
||||||
androidprv:digit="7"
|
androidprv:digit="8"
|
||||||
/>
|
androidprv:textView="@+id/pinEntry" />
|
||||||
<com.android.keyguard.NumPadKey
|
|
||||||
android:id="@+id/key8"
|
<com.android.keyguard.NumPadKey
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
android:id="@+id/key9"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
android:layout_height="0dp"
|
||||||
androidprv:textView="@+id/pinEntry"
|
androidprv:digit="9"
|
||||||
androidprv:digit="8"
|
androidprv:textView="@+id/pinEntry" />
|
||||||
/>
|
|
||||||
<com.android.keyguard.NumPadKey
|
|
||||||
android:id="@+id/key9"
|
<com.android.keyguard.NumPadButton
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
android:id="@+id/delete_button"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
androidprv:textView="@+id/pinEntry"
|
android:layout_height="0dp"
|
||||||
androidprv:digit="9"
|
style="@style/NumPadKey.Delete"
|
||||||
/>
|
android:contentDescription="@string/keyboardview_keycode_delete"
|
||||||
</LinearLayout>
|
/>
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/row4"
|
<com.android.keyguard.NumPadKey
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/key0"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:orientation="horizontal"
|
android:layout_height="0dp"
|
||||||
android:layout_gravity="center_horizontal"
|
androidprv:digit="0"
|
||||||
>
|
androidprv:textView="@+id/pinEntry" />
|
||||||
<com.android.keyguard.NumPadButton
|
|
||||||
android:id="@+id/delete_button"
|
<com.android.keyguard.NumPadButton
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
android:id="@+id/key_enter"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
android:layout_height="0dp"
|
||||||
android:contentDescription="@string/keyboardview_keycode_delete"
|
style="@style/NumPadKey.Enter"
|
||||||
style="@style/NumPadKey.Delete"
|
android:contentDescription="@string/keyboardview_keycode_enter"
|
||||||
/>
|
/>
|
||||||
<com.android.keyguard.NumPadKey
|
|
||||||
android:id="@+id/key0"
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginEnd="@dimen/num_pad_key_margin_end"
|
|
||||||
androidprv:textView="@+id/pinEntry"
|
|
||||||
androidprv:digit="0"
|
|
||||||
/>
|
|
||||||
<com.android.keyguard.NumPadButton
|
|
||||||
android:id="@+id/key_enter"
|
|
||||||
android:layout_width="@dimen/num_pad_key_width"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
style="@style/NumPadKey.Enter"
|
|
||||||
android:contentDescription="@string/keyboardview_keycode_enter"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
<include layout="@layout/keyguard_eca"
|
<include layout="@layout/keyguard_eca"
|
||||||
android:id="@+id/keyguard_selector_fade_container"
|
android:id="@+id/keyguard_selector_fade_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<string name="num_pad_key_ratio">1.51</string>
|
||||||
|
</resources>
|
||||||
@@ -26,4 +26,6 @@
|
|||||||
|
|
||||||
<!-- Skeleton string format for displaying the time in 24-hour format. -->
|
<!-- Skeleton string format for displaying the time in 24-hour format. -->
|
||||||
<string name="clock_24hr_format">Hm</string>
|
<string name="clock_24hr_format">Hm</string>
|
||||||
|
|
||||||
|
<string name="num_pad_key_ratio">1</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
<item name="android:colorControlNormal">@null</item>
|
<item name="android:colorControlNormal">@null</item>
|
||||||
<item name="android:colorControlHighlight">?android:attr/colorAccent</item>
|
<item name="android:colorControlHighlight">?android:attr/colorAccent</item>
|
||||||
<item name="android:background">@drawable/num_pad_key_background</item>
|
<item name="android:background">@drawable/num_pad_key_background</item>
|
||||||
|
|
||||||
|
<!-- Default values for NumPadKey used in a ConstraintLayout. -->
|
||||||
|
<item name="layout_constraintDimensionRatio">@string/num_pad_key_ratio</item>
|
||||||
|
<item name="layout_constraintWidth_max">@dimen/num_pad_key_width</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="Widget.TextView.NumPadKey.Digit"
|
<style name="Widget.TextView.NumPadKey.Digit"
|
||||||
parent="@android:style/Widget.DeviceDefault.TextView">
|
parent="@android:style/Widget.DeviceDefault.TextView">
|
||||||
|
|||||||
@@ -22,15 +22,14 @@ import android.util.AttributeSet;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
|
|
||||||
import com.android.internal.jank.InteractionJankMonitor;
|
import com.android.internal.jank.InteractionJankMonitor;
|
||||||
import com.android.settingslib.animation.AppearAnimationUtils;
|
import com.android.settingslib.animation.AppearAnimationUtils;
|
||||||
import com.android.settingslib.animation.DisappearAnimationUtils;
|
import com.android.settingslib.animation.DisappearAnimationUtils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a PIN pad for unlocking.
|
* Displays a PIN pad for unlocking.
|
||||||
*/
|
*/
|
||||||
@@ -40,10 +39,6 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
|||||||
private final DisappearAnimationUtils mDisappearAnimationUtils;
|
private final DisappearAnimationUtils mDisappearAnimationUtils;
|
||||||
private final DisappearAnimationUtils mDisappearAnimationUtilsLocked;
|
private final DisappearAnimationUtils mDisappearAnimationUtilsLocked;
|
||||||
private ViewGroup mContainer;
|
private ViewGroup mContainer;
|
||||||
private ViewGroup mRow0;
|
|
||||||
private ViewGroup mRow1;
|
|
||||||
private ViewGroup mRow2;
|
|
||||||
private ViewGroup mRow3;
|
|
||||||
private int mDisappearYTranslation;
|
private int mDisappearYTranslation;
|
||||||
private View[][] mViews;
|
private View[][] mViews;
|
||||||
|
|
||||||
@@ -82,30 +77,38 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateMargins() {
|
private void updateMargins() {
|
||||||
|
// Re-apply everything to the keys...
|
||||||
int bottomMargin = mContext.getResources().getDimensionPixelSize(
|
int bottomMargin = mContext.getResources().getDimensionPixelSize(
|
||||||
R.dimen.num_pad_row_margin_bottom);
|
|
||||||
|
|
||||||
for (ViewGroup vg : List.of(mRow1, mRow2, mRow3)) {
|
|
||||||
((LinearLayout.LayoutParams) vg.getLayoutParams()).setMargins(0, 0, 0, bottomMargin);
|
|
||||||
}
|
|
||||||
|
|
||||||
bottomMargin = mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.num_pad_entry_row_margin_bottom);
|
R.dimen.num_pad_entry_row_margin_bottom);
|
||||||
((LinearLayout.LayoutParams) mRow0.getLayoutParams()).setMargins(0, 0, 0, bottomMargin);
|
int rightMargin = mContext.getResources().getDimensionPixelSize(
|
||||||
|
R.dimen.num_pad_key_margin_end);
|
||||||
|
String ratio = mContext.getResources().getString(R.string.num_pad_key_ratio);
|
||||||
|
|
||||||
if (mEcaView != null) {
|
// mView contains all Views that make up the PIN pad; row0 = the entry test field, then
|
||||||
int ecaTopMargin = mContext.getResources().getDimensionPixelSize(
|
// rows 1-4 contain the buttons. Iterate over all views that make up the buttons in the pad,
|
||||||
R.dimen.keyguard_eca_top_margin);
|
// and re-set all the margins.
|
||||||
int ecaBottomMargin = mContext.getResources().getDimensionPixelSize(
|
for (int row = 1; row < 5; row++) {
|
||||||
R.dimen.keyguard_eca_bottom_margin);
|
for (int column = 0; column < 3; column++) {
|
||||||
((LinearLayout.LayoutParams) mEcaView.getLayoutParams()).setMargins(0, ecaTopMargin,
|
View key = mViews[row][column];
|
||||||
0, ecaBottomMargin);
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View entryView = findViewById(R.id.pinEntry);
|
|
||||||
ViewGroup.LayoutParams lp = entryView.getLayoutParams();
|
|
||||||
lp.height = mContext.getResources().getDimensionPixelSize(R.dimen.keyguard_password_height);
|
|
||||||
entryView.setLayoutParams(lp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -113,13 +116,9 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
|||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
|
|
||||||
mContainer = findViewById(R.id.pin_container);
|
mContainer = findViewById(R.id.pin_container);
|
||||||
mRow0 = findViewById(R.id.row0);
|
|
||||||
mRow1 = findViewById(R.id.row1);
|
|
||||||
mRow2 = findViewById(R.id.row2);
|
|
||||||
mRow3 = findViewById(R.id.row3);
|
|
||||||
mViews = new View[][]{
|
mViews = new View[][]{
|
||||||
new View[]{
|
new View[]{
|
||||||
mRow0, null, null
|
findViewById(R.id.row0), null, null
|
||||||
},
|
},
|
||||||
new View[]{
|
new View[]{
|
||||||
findViewById(R.id.key1), findViewById(R.id.key2),
|
findViewById(R.id.key1), findViewById(R.id.key2),
|
||||||
@@ -188,9 +187,6 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
|||||||
private void enableClipping(boolean enable) {
|
private void enableClipping(boolean enable) {
|
||||||
mContainer.setClipToPadding(enable);
|
mContainer.setClipToPadding(enable);
|
||||||
mContainer.setClipChildren(enable);
|
mContainer.setClipChildren(enable);
|
||||||
mRow1.setClipToPadding(enable);
|
|
||||||
mRow2.setClipToPadding(enable);
|
|
||||||
mRow3.setClipToPadding(enable);
|
|
||||||
setClipChildren(enable);
|
setClipChildren(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ public class NumPadButton extends AlphaOptimizedImageButton {
|
|||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
|
||||||
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
|
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
|
||||||
// the height to match the old pin bouncer
|
// the height to match the old pin bouncer.
|
||||||
|
// This is only used for PIN/PUK; the main PIN pad now uses ConstraintLayout, which will
|
||||||
|
// force our width/height to conform to the ratio in the layout.
|
||||||
int width = getMeasuredWidth();
|
int width = getMeasuredWidth();
|
||||||
|
|
||||||
boolean shortenHeight = mAnimator == null
|
boolean shortenHeight = mAnimator == null
|
||||||
|
|||||||
@@ -175,7 +175,9 @@ public class NumPadKey extends ViewGroup {
|
|||||||
measureChildren(widthMeasureSpec, heightMeasureSpec);
|
measureChildren(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
|
||||||
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
|
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
|
||||||
// the height to match the old pin bouncer
|
// the height to match the old pin bouncer.
|
||||||
|
// This is only used for PIN/PUK; the main PIN pad now uses ConstraintLayout, which will
|
||||||
|
// force our width/height to conform to the ratio in the layout.
|
||||||
int width = getMeasuredWidth();
|
int width = getMeasuredWidth();
|
||||||
|
|
||||||
boolean shortenHeight = mAnimator == null
|
boolean shortenHeight = mAnimator == null
|
||||||
|
|||||||
Reference in New Issue
Block a user