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:importantForAccessibility="noHideDescendants"
36        android:layout_width="match_parent"
37        android:layout_height="wrap_content"
38        android:orientation="vertical" />
39
40    <androidx.constraintlayout.widget.ConstraintLayout
41        android:id="@+id/pin_container"
42        android:layout_width="match_parent"
43        android:layout_height="0dp"
44        android:layout_marginBottom="8dp"
45        android:clipChildren="false"
46        android:clipToPadding="false"
47        android:layout_weight="1"
48        android:layoutDirection="ltr"
49        android:orientation="vertical">
50
51        <!-- Set this to be just above key1. It would be better to introduce a barrier above
52             key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
53             drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
54             case, the Flow should ensure that key1/2/3 all have the same top, so this should be
55             fine. -->
56        <com.android.keyguard.AlphaOptimizedRelativeLayout
57            android:id="@+id/row0"
58            android:layout_width="match_parent"
59            android:layout_height="wrap_content"
60            android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
61            androidprv:layout_constraintTop_toTopOf="parent"
62            androidprv:layout_constraintEnd_toEndOf="parent"
63            androidprv:layout_constraintStart_toStartOf="parent"
64            androidprv:layout_constraintBottom_toTopOf="@id/key1"
65            androidprv:layout_constraintVertical_bias="0.5">
66
67            <com.android.keyguard.PasswordTextView
68                android:id="@+id/pinEntry"
69                style="@style/Widget.TextView.Password"
70                android:layout_width="@dimen/keyguard_security_width"
71                android:layout_height="@dimen/keyguard_password_height"
72                android:layout_centerHorizontal="true"
73                android:layout_marginRight="72dp"
74                android:contentDescription="@string/keyguard_accessibility_pin_area"
75                androidprv:scaledTextSize="@integer/scaled_password_text_size" />
76        </com.android.keyguard.AlphaOptimizedRelativeLayout>
77
78        <!-- Guideline used to place the top row of keys relative to the screen height. This will be
79             updated in KeyguardPINView to reduce the height of the PIN pad. -->
80        <androidx.constraintlayout.widget.Guideline
81            android:id="@+id/pin_pad_top_guideline"
82            android:layout_width="wrap_content"
83            android:layout_height="wrap_content"
84            androidprv:layout_constraintGuide_percent="0"
85            android:orientation="horizontal" />
86
87        <com.android.keyguard.KeyguardPinFlowView
88            android:id="@+id/flow1"
89            android:layout_width="0dp"
90            android:layout_height="0dp"
91            android:orientation="horizontal"
92            android:clipChildren="false"
93            android:clipToPadding="false"
94
95            androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
96
97            androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
98
99            androidprv:flow_horizontalStyle="packed"
100            androidprv:flow_maxElementsWrap="3"
101
102            androidprv:flow_verticalBias="1.0"
103            androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
104            androidprv:flow_verticalStyle="packed"
105
106            androidprv:flow_wrapMode="aligned"
107            androidprv:layout_constraintBottom_toBottomOf="parent"
108            androidprv:layout_constraintEnd_toEndOf="parent"
109            androidprv:layout_constraintStart_toStartOf="parent"
110            androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
111
112        <com.android.keyguard.NumPadKey
113            android:id="@+id/key1"
114            android:layout_width="0dp"
115            android:layout_height="0dp"
116            android:accessibilityTraversalBefore="@id/key2"
117            androidprv:digit="1"
118            androidprv:textView="@+id/pinEntry" />
119
120        <com.android.keyguard.NumPadKey
121            android:id="@+id/key2"
122            android:layout_width="0dp"
123            android:layout_height="0dp"
124            android:accessibilityTraversalBefore="@id/key3"
125            androidprv:digit="2"
126            androidprv:textView="@+id/pinEntry" />
127
128        <com.android.keyguard.NumPadKey
129            android:id="@+id/key3"
130            android:layout_width="0dp"
131            android:layout_height="0dp"
132            android:accessibilityTraversalBefore="@id/key4"
133            androidprv:digit="3"
134            androidprv:textView="@+id/pinEntry" />
135
136        <com.android.keyguard.NumPadKey
137            android:id="@+id/key4"
138            android:layout_width="0dp"
139            android:layout_height="0dp"
140            android:accessibilityTraversalBefore="@id/key5"
141            androidprv:digit="4"
142            androidprv:textView="@+id/pinEntry" />
143
144        <com.android.keyguard.NumPadKey
145            android:id="@+id/key5"
146            android:layout_width="0dp"
147            android:layout_height="0dp"
148            android:accessibilityTraversalBefore="@id/key6"
149            androidprv:digit="5"
150            androidprv:textView="@+id/pinEntry" />
151
152        <com.android.keyguard.NumPadKey
153            android:id="@+id/key6"
154            android:layout_width="0dp"
155            android:layout_height="0dp"
156            android:accessibilityTraversalBefore="@id/key7"
157            androidprv:digit="6"
158            androidprv:textView="@+id/pinEntry" />
159
160        <com.android.keyguard.NumPadKey
161            android:id="@+id/key7"
162            android:layout_width="0dp"
163            android:layout_height="0dp"
164            android:accessibilityTraversalBefore="@id/key8"
165            androidprv:digit="7"
166            androidprv:textView="@+id/pinEntry" />
167
168
169        <com.android.keyguard.NumPadKey
170            android:id="@+id/key8"
171            android:layout_width="0dp"
172            android:layout_height="0dp"
173            android:accessibilityTraversalBefore="@id/key9"
174            androidprv:digit="8"
175            androidprv:textView="@+id/pinEntry" />
176
177        <com.android.keyguard.NumPadKey
178            android:id="@+id/key9"
179            android:layout_width="0dp"
180            android:layout_height="0dp"
181            android:accessibilityTraversalBefore="@id/delete_button"
182            androidprv:digit="9"
183            androidprv:textView="@+id/pinEntry" />
184
185        <com.android.keyguard.NumPadButton
186            android:id="@+id/delete_button"
187            style="@style/NumPadKey.Delete"
188            android:layout_width="0dp"
189            android:layout_height="0dp"
190            android:accessibilityTraversalBefore="@id/key0"
191            android:contentDescription="@string/keyboardview_keycode_delete" />
192
193        <com.android.keyguard.NumPadKey
194            android:id="@+id/key0"
195            android:layout_width="0dp"
196            android:layout_height="0dp"
197            android:accessibilityTraversalBefore="@id/key_enter"
198            androidprv:digit="0"
199            androidprv:textView="@+id/pinEntry" />
200
201        <com.android.keyguard.NumPadButton
202            android:id="@+id/key_enter"
203            style="@style/NumPadKey.Enter"
204            android:layout_width="0dp"
205            android:layout_height="0dp"
206            android:contentDescription="@string/keyboardview_keycode_enter" />
207    </androidx.constraintlayout.widget.ConstraintLayout>
208
209    <include layout="@layout/keyguard_eca"
210        android:id="@+id/keyguard_selector_fade_container"
211        android:layout_width="match_parent"
212        android:layout_height="wrap_content"
213        android:orientation="vertical"
214        android:layout_gravity="bottom|center_horizontal"
215        android:layout_marginTop="@dimen/keyguard_eca_top_margin"
216        android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
217        android:gravity="center_horizontal"/>
218
219</com.android.keyguard.KeyguardPINView>
220