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<!-- This file is needed when flag lockscreen.enable_landscape is on
20     Required for landscape lockscreen on small screens. -->
21<com.android.keyguard.KeyguardPINView xmlns:android="http://schemas.android.com/apk/res/android"
22    xmlns:androidprv="http://schemas.android.com/apk/res-auto"
23    android:id="@+id/keyguard_pin_view"
24    android:layout_width="match_parent"
25    android:layout_height="match_parent"
26    android:layout_gravity="center_horizontal|bottom"
27    android:clipChildren="false"
28    android:clipToPadding="false"
29    android:orientation="vertical">
30
31    <!-- Layout here is visually identical to the previous keyguard_pin_view.
32         I.E., 'constraints here effectively the same as the previous linear layout '-->
33    <androidx.constraintlayout.motion.widget.MotionLayout
34        android:id="@+id/pin_container"
35        android:layout_width="match_parent"
36        android:layout_height="match_parent"
37        android:maxWidth="@dimen/keyguard_security_width"
38        android:clipChildren="false"
39        android:clipToPadding="false"
40        android:layoutDirection="ltr"
41        android:orientation="vertical"
42        androidprv:layoutDescription="@xml/keyguard_pin_scene"
43        android:layout_gravity="center_horizontal">
44
45        <!-- Guideline need to align PIN pad left of centre,
46        when on small screen landscape layout -->
47        <androidx.constraintlayout.widget.Guideline
48            android:id="@+id/pin_pad_center_guideline"
49            android:layout_width="wrap_content"
50            android:layout_height="wrap_content"
51            android:orientation="vertical"
52            androidprv:layout_constraintGuide_percent="0.5" />
53
54        <!-- Guideline used to place the top row of keys relative to the screen height. This will be
55        updated in KeyguardPINView to reduce the height of the PIN pad. -->
56        <androidx.constraintlayout.widget.Guideline
57            android:id="@+id/pin_pad_top_guideline"
58            android:layout_width="wrap_content"
59            android:layout_height="wrap_content"
60            android:orientation="horizontal"
61            androidprv:layout_constraintGuide_percent="0" />
62
63        <LinearLayout
64            android:id="@+id/keyguard_bouncer_message_container"
65            android:layout_width="match_parent"
66            android:layout_height="wrap_content"
67            android:clipChildren="false"
68            android:clipToPadding="false"
69            android:layoutDirection="ltr"
70            android:orientation="vertical"
71            androidprv:layout_constraintTop_toTopOf="parent">
72
73            <include layout="@layout/keyguard_bouncer_message_area" />
74
75            <com.android.systemui.bouncer.ui.BouncerMessageView
76                android:id="@+id/bouncer_message_view"
77                android:importantForAccessibility="noHideDescendants"
78                android:layout_width="match_parent"
79                android:layout_height="wrap_content"
80                android:orientation="vertical" />
81
82        </LinearLayout>
83
84        <!-- Set this to be just above key1. It would be better to introduce a barrier above
85          key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
86          drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
87          case, the Flow should ensure that key1/2/3 all have the same top, so this should be
88          fine. -->
89        <com.android.keyguard.AlphaOptimizedRelativeLayout
90            android:id="@+id/row0"
91            android:layout_width="match_parent"
92            android:layout_height="wrap_content"
93            android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
94            androidprv:layout_constraintBottom_toTopOf="@id/key1"
95            androidprv:layout_constraintEnd_toEndOf="parent"
96            androidprv:layout_constraintStart_toStartOf="parent"
97            androidprv:layout_constraintTop_toBottomOf="@id/keyguard_bouncer_message_container"
98            androidprv:layout_constraintVertical_bias="0.5">
99
100            <com.android.keyguard.PasswordTextView
101                android:id="@+id/pinEntry"
102                style="@style/Widget.TextView.Password"
103                android:layout_width="@dimen/keyguard_security_width"
104                android:layout_height="@dimen/keyguard_password_height"
105                android:layout_centerHorizontal="true"
106                android:layout_marginRight="72dp"
107                android:contentDescription="@string/keyguard_accessibility_pin_area"
108                androidprv:scaledTextSize="@integer/scaled_password_text_size" />
109
110        </com.android.keyguard.AlphaOptimizedRelativeLayout>
111
112        <com.android.keyguard.KeyguardPinFlowView
113            android:id="@+id/flow1"
114            android:layout_width="0dp"
115            android:layout_height="0dp"
116            android:layout_marginBottom="8dp"
117            android:clipChildren="false"
118            android:clipToPadding="false"
119            android:orientation="horizontal"
120
121            androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
122
123            androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
124            androidprv:flow_horizontalStyle="packed"
125            androidprv:flow_maxElementsWrap="3"
126
127            androidprv:flow_verticalBias="1.0"
128            androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
129            androidprv:flow_verticalStyle="packed"
130            androidprv:flow_wrapMode="aligned"
131
132            androidprv:layout_constraintBottom_toTopOf="@+id/keyguard_selector_fade_container"
133            androidprv:layout_constraintEnd_toEndOf="parent"
134            androidprv:layout_constraintStart_toStartOf="parent"
135            androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
136
137        <com.android.keyguard.NumPadButton
138            android:id="@+id/delete_button"
139            style="@style/NumPadKey.Delete"
140            android:layout_width="0dp"
141            android:layout_height="0dp"
142            android:accessibilityTraversalBefore="@id/key0"
143            android:contentDescription="@string/keyboardview_keycode_delete" />
144
145        <com.android.keyguard.NumPadButton
146            android:id="@+id/key_enter"
147            style="@style/NumPadKey.Enter"
148            android:layout_width="0dp"
149            android:layout_height="0dp"
150            android:contentDescription="@string/keyboardview_keycode_enter" />
151
152        <com.android.keyguard.NumPadKey
153            android:id="@+id/key1"
154            android:layout_width="0dp"
155            android:layout_height="0dp"
156            android:accessibilityTraversalBefore="@id/key2"
157            androidprv:digit="1"
158            androidprv:textView="@+id/pinEntry" />
159
160        <com.android.keyguard.NumPadKey
161            android:id="@+id/key2"
162            android:layout_width="0dp"
163            android:layout_height="0dp"
164            android:accessibilityTraversalBefore="@id/key3"
165            androidprv:digit="2"
166            androidprv:textView="@+id/pinEntry" />
167
168        <com.android.keyguard.NumPadKey
169            android:id="@+id/key3"
170            android:layout_width="0dp"
171            android:layout_height="0dp"
172            android:accessibilityTraversalBefore="@id/key4"
173            androidprv:digit="3"
174            androidprv:textView="@+id/pinEntry" />
175
176        <com.android.keyguard.NumPadKey
177            android:id="@+id/key4"
178            android:layout_width="0dp"
179            android:layout_height="0dp"
180            android:accessibilityTraversalBefore="@id/key5"
181            androidprv:digit="4"
182            androidprv:textView="@+id/pinEntry" />
183
184        <com.android.keyguard.NumPadKey
185            android:id="@+id/key5"
186            android:layout_width="0dp"
187            android:layout_height="0dp"
188            android:accessibilityTraversalBefore="@id/key6"
189            androidprv:digit="5"
190            androidprv:textView="@+id/pinEntry" />
191
192        <com.android.keyguard.NumPadKey
193            android:id="@+id/key6"
194            android:layout_width="0dp"
195            android:layout_height="0dp"
196            android:accessibilityTraversalBefore="@id/key7"
197            androidprv:digit="6"
198            androidprv:textView="@+id/pinEntry" />
199
200        <com.android.keyguard.NumPadKey
201            android:id="@+id/key7"
202            android:layout_width="0dp"
203            android:layout_height="0dp"
204            android:accessibilityTraversalBefore="@id/key8"
205            androidprv:digit="7"
206            androidprv:textView="@+id/pinEntry" />
207
208        <com.android.keyguard.NumPadKey
209            android:id="@+id/key8"
210            android:layout_width="0dp"
211            android:layout_height="0dp"
212            android:accessibilityTraversalBefore="@id/key9"
213            androidprv:digit="8"
214            androidprv:textView="@+id/pinEntry" />
215
216        <com.android.keyguard.NumPadKey
217            android:id="@+id/key9"
218            android:layout_width="0dp"
219            android:layout_height="0dp"
220            android:accessibilityTraversalBefore="@id/delete_button"
221            androidprv:digit="9"
222            androidprv:textView="@+id/pinEntry" />
223
224        <com.android.keyguard.NumPadKey
225            android:id="@+id/key0"
226            android:layout_width="0dp"
227            android:layout_height="0dp"
228            android:accessibilityTraversalBefore="@id/key_enter"
229            androidprv:digit="0"
230            androidprv:textView="@+id/pinEntry" />
231
232        <include
233            android:id="@+id/keyguard_selector_fade_container"
234            layout="@layout/keyguard_eca"
235            android:layout_width="match_parent"
236            android:layout_height="wrap_content"
237            android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
238            android:layout_marginTop="@dimen/keyguard_eca_top_margin"
239            android:orientation="vertical"
240            androidprv:layout_constraintBottom_toBottomOf="parent"
241            androidprv:layout_constraintTop_toBottomOf="@+id/flow1" />
242
243    </androidx.constraintlayout.motion.widget.MotionLayout>
244
245</com.android.keyguard.KeyguardPINView>
246