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