1<?xml version="1.0" encoding="utf-8"?><!--
2**
3** Copyright 2023, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License")
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17-->
18
19<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android"
20    xmlns:androidprv="http://schemas.android.com/apk/res-auto"
21    xmlns:tools="http://schemas.android.com/tools"
22    android:id="@+id/keyguard_pin_view"
23    android:layout_width="match_parent"
24    android:layout_height="match_parent"
25    android:layout_gravity="center_horizontal|bottom"
26    android:clipChildren="false"
27    android:clipToPadding="false"
28    android:orientation="horizontal">
29
30    <androidx.constraintlayout.widget.ConstraintLayout
31        android:layout_width="0dp"
32        android:layout_height="match_parent"
33        android:layout_weight="2"
34        android:clipChildren="false"
35        android:clipToPadding="false"
36        android:layoutDirection="ltr"
37        android:orientation="vertical">
38
39        <include layout="@layout/keyguard_bouncer_message_area" />
40
41        <com.android.systemui.bouncer.ui.BouncerMessageView
42            android:id="@+id/bouncer_message_view"
43            android:layout_width="match_parent"
44            android:layout_height="wrap_content"
45            android:orientation="vertical"
46            androidprv:layout_constraintBottom_toTopOf="@+id/row0"
47            androidprv:layout_constraintTop_toTopOf="parent"
48            androidprv:layout_constraintVertical_chainStyle="packed" />
49
50        <!-- Set this to be just above key1. It would be better to introduce a barrier above
51         key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
52         drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
53         case, the Flow should ensure that key1/2/3 all have the same top, so this should be
54         fine. -->
55        <com.android.keyguard.AlphaOptimizedRelativeLayout
56            android:id="@+id/row0"
57            android:layout_width="match_parent"
58            android:layout_height="wrap_content"
59            android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
60            androidprv:layout_constraintBottom_toTopOf="@+id/keyguard_selector_fade_container"
61            androidprv:layout_constraintTop_toBottomOf="@+id/bouncer_message_view"
62            tools:layout_editor_absoluteX="-16dp">
63
64            <com.android.keyguard.PasswordTextView
65                android:id="@+id/pinEntry"
66                style="@style/Widget.TextView.Password"
67                android:layout_width="@dimen/keyguard_security_width"
68                android:layout_height="@dimen/keyguard_password_height"
69                android:layout_centerHorizontal="true"
70                android:layout_marginRight="72dp"
71                android:contentDescription="@string/keyguard_accessibility_pin_area"
72                androidprv:scaledTextSize="@integer/scaled_password_text_size" />
73        </com.android.keyguard.AlphaOptimizedRelativeLayout>
74
75        <include
76            android:id="@+id/keyguard_selector_fade_container"
77            layout="@layout/keyguard_eca"
78            android:layout_width="match_parent"
79            android:layout_height="wrap_content"
80            android:layout_gravity="bottom|center_horizontal"
81            android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
82            android:layout_marginTop="@dimen/keyguard_eca_top_margin"
83            android:gravity="center_horizontal"
84            android:orientation="vertical"
85            androidprv:layout_constraintBottom_toBottomOf="parent" />
86
87    </androidx.constraintlayout.widget.ConstraintLayout>
88
89    <androidx.constraintlayout.widget.ConstraintLayout
90        android:id="@+id/pin_container"
91        android:layout_width="0dp"
92        android:layout_height="match_parent"
93        android:layout_weight="3"
94        android:clipChildren="false"
95        android:clipToPadding="false"
96        android:layoutDirection="ltr"
97        android:orientation="vertical">
98
99        <!-- Guideline used to place the top row of keys relative to the screen height. This will be
100        updated in KeyguardPINView to reduce the height of the PIN pad. -->
101        <androidx.constraintlayout.widget.Guideline
102            android:id="@+id/pin_pad_top_guideline"
103            android:layout_width="wrap_content"
104            android:layout_height="wrap_content"
105            android:orientation="horizontal"
106            androidprv:layout_constraintGuide_percent="0" />
107
108        <com.android.keyguard.KeyguardPinFlowView
109            android:id="@+id/flow1"
110            android:layout_width="0dp"
111            android:layout_height="0dp"
112            android:clipChildren="false"
113            android:clipToPadding="false"
114            android:orientation="horizontal"
115
116            androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
117
118            androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
119
120            androidprv:flow_horizontalStyle="packed"
121            androidprv:flow_maxElementsWrap="3"
122
123            androidprv:flow_verticalBias="0.5"
124            androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
125            androidprv:flow_verticalStyle="packed"
126
127            androidprv:flow_wrapMode="aligned"
128            androidprv:layout_constraintBottom_toBottomOf="parent"
129            androidprv:layout_constraintEnd_toEndOf="parent"
130            androidprv:layout_constraintStart_toStartOf="parent"
131            androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
132
133        <com.android.keyguard.NumPadButton
134            android:id="@+id/delete_button"
135            style="@style/NumPadKey.Delete"
136            android:layout_width="0dp"
137            android:layout_height="0dp"
138            android:accessibilityTraversalBefore="@id/key0"
139            android:contentDescription="@string/keyboardview_keycode_delete" />
140
141        <com.android.keyguard.NumPadButton
142            android:id="@+id/key_enter"
143            style="@style/NumPadKey.Enter"
144            android:layout_width="0dp"
145            android:layout_height="0dp"
146            android:contentDescription="@string/keyboardview_keycode_enter" />
147
148        <com.android.keyguard.NumPadKey
149            android:id="@+id/key1"
150            android:layout_width="0dp"
151            android:layout_height="0dp"
152            android:accessibilityTraversalBefore="@id/key2"
153            androidprv:digit="1"
154            androidprv:textView="@+id/pinEntry" />
155
156        <com.android.keyguard.NumPadKey
157            android:id="@+id/key2"
158            android:layout_width="0dp"
159            android:layout_height="0dp"
160            android:accessibilityTraversalBefore="@id/key3"
161            androidprv:digit="2"
162            androidprv:textView="@+id/pinEntry" />
163
164        <com.android.keyguard.NumPadKey
165            android:id="@+id/key3"
166            android:layout_width="0dp"
167            android:layout_height="0dp"
168            android:accessibilityTraversalBefore="@id/key4"
169            androidprv:digit="3"
170            androidprv:textView="@+id/pinEntry" />
171
172        <com.android.keyguard.NumPadKey
173            android:id="@+id/key4"
174            android:layout_width="0dp"
175            android:layout_height="0dp"
176            android:accessibilityTraversalBefore="@id/key5"
177            androidprv:digit="4"
178            androidprv:textView="@+id/pinEntry" />
179
180        <com.android.keyguard.NumPadKey
181            android:id="@+id/key5"
182            android:layout_width="0dp"
183            android:layout_height="0dp"
184            android:accessibilityTraversalBefore="@id/key6"
185            androidprv:digit="5"
186            androidprv:textView="@+id/pinEntry" />
187
188
189        <com.android.keyguard.NumPadKey
190            android:id="@+id/key6"
191            android:layout_width="0dp"
192            android:layout_height="0dp"
193            android:accessibilityTraversalBefore="@id/key7"
194            androidprv:digit="6"
195            androidprv:textView="@+id/pinEntry" />
196
197        <com.android.keyguard.NumPadKey
198            android:id="@+id/key7"
199            android:layout_width="0dp"
200            android:layout_height="0dp"
201            android:accessibilityTraversalBefore="@id/key8"
202            androidprv:digit="7"
203            androidprv:textView="@+id/pinEntry" />
204
205        <com.android.keyguard.NumPadKey
206            android:id="@+id/key8"
207            android:layout_width="0dp"
208            android:layout_height="0dp"
209            android:accessibilityTraversalBefore="@id/key9"
210            androidprv:digit="8"
211            androidprv:textView="@+id/pinEntry" />
212
213        <com.android.keyguard.NumPadKey
214            android:id="@+id/key9"
215            android:layout_width="0dp"
216            android:layout_height="0dp"
217            android:accessibilityTraversalBefore="@id/delete_button"
218            androidprv:digit="9"
219            androidprv:textView="@+id/pinEntry" />
220
221        <com.android.keyguard.NumPadKey
222            android:id="@+id/key0"
223            android:layout_width="0dp"
224            android:layout_height="0dp"
225            android:accessibilityTraversalBefore="@id/key_enter"
226            androidprv:digit="0"
227            androidprv:textView="@+id/pinEntry" />
228
229    </androidx.constraintlayout.widget.ConstraintLayout>
230
231</com.android.keyguard.KeyguardPINView>
232