• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:screenReaderFocusable="true"
78                android:accessibilityLiveRegion="polite"
79                android:layout_width="match_parent"
80                android:layout_height="wrap_content"
81                android:orientation="vertical" />
82
83        </LinearLayout>
84
85        <!-- Set this to be just above key1. It would be better to introduce a barrier above
86          key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
87          drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
88          case, the Flow should ensure that key1/2/3 all have the same top, so this should be
89          fine. -->
90        <com.android.keyguard.AlphaOptimizedRelativeLayout
91            android:id="@+id/row0"
92            android:layout_width="match_parent"
93            android:layout_height="wrap_content"
94            android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
95            androidprv:layout_constraintBottom_toTopOf="@id/key1"
96            androidprv:layout_constraintEnd_toEndOf="parent"
97            androidprv:layout_constraintStart_toStartOf="parent"
98            androidprv:layout_constraintTop_toBottomOf="@id/keyguard_bouncer_message_container"
99            androidprv:layout_constraintVertical_bias="0.5">
100
101            <com.android.keyguard.PasswordTextView
102                android:id="@+id/pinEntry"
103                style="@style/Widget.TextView.Password"
104                android:layout_width="@dimen/keyguard_security_width"
105                android:layout_height="@dimen/keyguard_password_height"
106                android:layout_centerHorizontal="true"
107                android:layout_marginRight="72dp"
108                android:contentDescription="@string/keyguard_accessibility_pin_area"
109                androidprv:scaledTextSize="@integer/scaled_password_text_size" />
110
111        </com.android.keyguard.AlphaOptimizedRelativeLayout>
112
113        <com.android.keyguard.KeyguardPinFlowView
114            android:id="@+id/flow1"
115            android:layout_width="0dp"
116            android:layout_height="0dp"
117            android:layout_marginBottom="8dp"
118            android:clipChildren="false"
119            android:clipToPadding="false"
120            android:orientation="horizontal"
121
122            androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
123
124            androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
125            androidprv:flow_horizontalStyle="packed"
126            androidprv:flow_maxElementsWrap="3"
127
128            androidprv:flow_verticalBias="1.0"
129            androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
130            androidprv:flow_verticalStyle="packed"
131            androidprv:flow_wrapMode="aligned"
132
133            androidprv:layout_constraintBottom_toTopOf="@+id/keyguard_selector_fade_container"
134            androidprv:layout_constraintEnd_toEndOf="parent"
135            androidprv:layout_constraintStart_toStartOf="parent"
136            androidprv:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
137
138        <com.android.keyguard.NumPadButton
139            android:id="@+id/delete_button"
140            style="@style/NumPadKey.Delete"
141            android:layout_width="0dp"
142            android:layout_height="0dp"
143            android:accessibilityTraversalBefore="@id/key0"
144            android:contentDescription="@string/keyboardview_keycode_delete" />
145
146        <com.android.keyguard.NumPadButton
147            android:id="@+id/key_enter"
148            style="@style/NumPadKey.Enter"
149            android:layout_width="0dp"
150            android:layout_height="0dp"
151            android:contentDescription="@string/keyboardview_keycode_enter" />
152
153        <com.android.keyguard.NumPadKey
154            android:id="@+id/key1"
155            android:layout_width="0dp"
156            android:layout_height="0dp"
157            android:accessibilityTraversalBefore="@id/key2"
158            androidprv:digit="1"
159            androidprv:textView="@+id/pinEntry" />
160
161        <com.android.keyguard.NumPadKey
162            android:id="@+id/key2"
163            android:layout_width="0dp"
164            android:layout_height="0dp"
165            android:accessibilityTraversalBefore="@id/key3"
166            androidprv:digit="2"
167            androidprv:textView="@+id/pinEntry" />
168
169        <com.android.keyguard.NumPadKey
170            android:id="@+id/key3"
171            android:layout_width="0dp"
172            android:layout_height="0dp"
173            android:accessibilityTraversalBefore="@id/key4"
174            androidprv:digit="3"
175            androidprv:textView="@+id/pinEntry" />
176
177        <com.android.keyguard.NumPadKey
178            android:id="@+id/key4"
179            android:layout_width="0dp"
180            android:layout_height="0dp"
181            android:accessibilityTraversalBefore="@id/key5"
182            androidprv:digit="4"
183            androidprv:textView="@+id/pinEntry" />
184
185        <com.android.keyguard.NumPadKey
186            android:id="@+id/key5"
187            android:layout_width="0dp"
188            android:layout_height="0dp"
189            android:accessibilityTraversalBefore="@id/key6"
190            androidprv:digit="5"
191            androidprv:textView="@+id/pinEntry" />
192
193        <com.android.keyguard.NumPadKey
194            android:id="@+id/key6"
195            android:layout_width="0dp"
196            android:layout_height="0dp"
197            android:accessibilityTraversalBefore="@id/key7"
198            androidprv:digit="6"
199            androidprv:textView="@+id/pinEntry" />
200
201        <com.android.keyguard.NumPadKey
202            android:id="@+id/key7"
203            android:layout_width="0dp"
204            android:layout_height="0dp"
205            android:accessibilityTraversalBefore="@id/key8"
206            androidprv:digit="7"
207            androidprv:textView="@+id/pinEntry" />
208
209        <com.android.keyguard.NumPadKey
210            android:id="@+id/key8"
211            android:layout_width="0dp"
212            android:layout_height="0dp"
213            android:accessibilityTraversalBefore="@id/key9"
214            androidprv:digit="8"
215            androidprv:textView="@+id/pinEntry" />
216
217        <com.android.keyguard.NumPadKey
218            android:id="@+id/key9"
219            android:layout_width="0dp"
220            android:layout_height="0dp"
221            android:accessibilityTraversalBefore="@id/delete_button"
222            androidprv:digit="9"
223            androidprv:textView="@+id/pinEntry" />
224
225        <com.android.keyguard.NumPadKey
226            android:id="@+id/key0"
227            android:layout_width="0dp"
228            android:layout_height="0dp"
229            android:accessibilityTraversalBefore="@id/key_enter"
230            androidprv:digit="0"
231            androidprv:textView="@+id/pinEntry" />
232
233        <include
234            android:id="@+id/keyguard_selector_fade_container"
235            layout="@layout/keyguard_eca"
236            android:layout_width="match_parent"
237            android:layout_height="wrap_content"
238            android:layout_marginBottom="@dimen/keyguard_eca_bottom_margin"
239            android:layout_marginTop="@dimen/keyguard_eca_top_margin"
240            android:orientation="vertical"
241            androidprv:layout_constraintBottom_toBottomOf="parent"
242            androidprv:layout_constraintTop_toBottomOf="@+id/flow1" />
243
244    </androidx.constraintlayout.motion.widget.MotionLayout>
245
246</com.android.keyguard.KeyguardPINView>
247