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