• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2021 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  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  -->
16
17<!-- Car customizations
18     - Added title "Enter your PIN" under the entry field
19     - Put backspace and enter buttons in row 4
20     - PIN pad is on start side while entry field and title are on the end side
21     -  Hid the emergency call at the bottom
22-->
23
24<com.android.systemui.car.keyguard.CarKeyguardPINView
25    xmlns:android="http://schemas.android.com/apk/res/android"
26    xmlns:app="http://schemas.android.com/apk/res-auto"
27    android:id="@+id/keyguard_pin_view"
28    android:layout_width="match_parent"
29    android:layout_height="match_parent"
30    android:orientation="horizontal"
31    android:paddingHorizontal="@dimen/keyguard_pin_view_padding_horizontal">
32
33    <FrameLayout
34        android:layout_width="0dp"
35        android:layout_weight="1"
36        android:layout_height="match_parent">
37
38        <androidx.constraintlayout.widget.ConstraintLayout
39            android:id="@+id/pin_container"
40            android:layout_width="match_parent"
41            android:layout_height="match_parent"
42            android:layout_marginBottom="8dp"
43            android:layout_weight="1"
44            android:layoutDirection="ltr"
45            android:orientation="vertical">
46
47            <!-- Guideline used to place the top row of keys relative to the screen height.
48                This will be updated in CarKeyguardPINView to reduce the height of the PIN pad. -->
49            <androidx.constraintlayout.widget.Guideline
50                android:id="@+id/pin_pad_top_guideline"
51                android:layout_width="wrap_content"
52                android:layout_height="wrap_content"
53                android:orientation="horizontal"
54                app:layout_constraintGuide_percent="0"/>
55
56            <androidx.constraintlayout.helper.widget.Flow
57                android:id="@+id/flow1"
58                android:layout_width="0dp"
59                android:layout_height="0dp"
60                android:orientation="horizontal"
61                app:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
62                app:flow_horizontalGap="@dimen/num_pad_key_margin_end"
63                app:flow_horizontalStyle="packed"
64                app:flow_maxElementsWrap="3"
65                app:flow_verticalBias="0.5"
66                app:flow_verticalGap="@dimen/num_pad_key_margin_bottom"
67                app:flow_verticalStyle="packed"
68                app:flow_wrapMode="aligned"
69                app:layout_constraintBottom_toBottomOf="parent"
70                app:layout_constraintEnd_toEndOf="parent"
71                app:layout_constraintStart_toStartOf="parent"
72                app:layout_constraintTop_toBottomOf="@id/pin_pad_top_guideline" />
73
74            <include layout="@layout/num_pad_keys"/>
75        </androidx.constraintlayout.widget.ConstraintLayout>
76    </FrameLayout>
77
78    <LinearLayout
79        android:layout_width="0dp"
80        android:layout_height="match_parent"
81        android:layout_weight="1"
82        android:gravity="center"
83        android:orientation="vertical">
84
85        <com.android.keyguard.PasswordTextView
86            android:id="@+id/pinEntry"
87            android:layout_width="@dimen/keyguard_security_width"
88            android:layout_height="@dimen/pin_entry_height"
89            android:gravity="center"
90            android:focusedByDefault="true"
91            app:scaledTextSize="@integer/password_text_view_scale"
92            android:contentDescription="@string/keyguard_accessibility_pin_area" />
93
94        <View
95            android:id="@+id/divider"
96            android:layout_width="@dimen/keyguard_security_width"
97            android:layout_height="@dimen/divider_height"
98            android:background="?oemColorOnSurface" />
99
100        <TextView
101            android:layout_width="wrap_content"
102            android:layout_height="wrap_content"
103            android:layout_margin="@*android:dimen/car_padding_2"
104            android:gravity="center"
105            android:textAppearance="?oemTextAppearanceTitleLarge"
106            android:text="@string/car_keyguard_enter_your_pin" />
107
108        <include layout="@layout/keyguard_message_area" />
109
110        <Button
111            android:id="@+id/cancel_button"
112            android:layout_width="wrap_content"
113            android:layout_height="wrap_content"
114            android:layout_gravity="center"
115            style="@style/KeyguardButton"
116            android:text="@string/cancel"/>
117    </LinearLayout>
118
119    <!-- CarKeyguardPinView references these resources ids in code so removing them will cause the
120         keyguard to crash. Instead put them down here where they are out of the way and set their
121         visibility to gone. -->
122    <com.android.keyguard.AlphaOptimizedRelativeLayout
123        android:id="@+id/row0"
124        android:layout_width="0dp"
125        android:layout_height="0dp"
126        android:visibility="gone" />
127
128    <LinearLayout
129        android:id="@+id/row1"
130        android:layout_width="0dp"
131        android:layout_height="0dp"
132        android:visibility="gone" />
133
134    <LinearLayout
135        android:id="@+id/row2"
136        android:layout_width="0dp"
137        android:layout_height="0dp"
138        android:visibility="gone" />
139
140    <LinearLayout
141        android:id="@+id/row3"
142        android:layout_width="0dp"
143        android:layout_height="0dp"
144        android:visibility="gone" />
145
146    <LinearLayout
147        android:id="@+id/row4"
148        android:layout_width="0dp"
149        android:layout_height="0dp"
150        android:visibility="gone" />
151
152    <include layout="@layout/keyguard_eca"
153             android:id="@+id/keyguard_selector_fade_container"
154             android:layout_width="0dp"
155             android:layout_height="0dp"
156             android:visibility="gone" />
157</com.android.systemui.car.keyguard.CarKeyguardPINView>
158