• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright 2018, 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<!-- Car customizations
19     - Added title "Enter your PIN" under the entry field
20     - Put backspace and enter buttons in row 4
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            <androidx.constraintlayout.helper.widget.Flow
48                android:id="@+id/flow1"
49                android:layout_width="0dp"
50                android:layout_height="0dp"
51                android:orientation="horizontal"
52                app:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
53                app:flow_horizontalGap="@dimen/num_pad_key_margin_end"
54                app:flow_horizontalStyle="packed"
55                app:flow_maxElementsWrap="3"
56                app:flow_verticalStyle="packed"
57                app:flow_wrapMode="aligned"
58                app:layout_constraintEnd_toEndOf="parent"
59                app:layout_constraintStart_toStartOf="parent"
60                app:layout_constraintTop_toTopOf="parent"
61                app:layout_constraintBottom_toBottomOf="parent" />
62
63            <include layout="@layout/num_pad_keys"/>
64        </androidx.constraintlayout.widget.ConstraintLayout>
65    </FrameLayout>
66
67    <LinearLayout
68        android:layout_width="0dp"
69        android:layout_height="match_parent"
70        android:layout_weight="1"
71        android:gravity="center"
72        android:orientation="vertical">
73
74        <com.android.keyguard.PasswordTextView
75            android:id="@+id/pinEntry"
76            android:layout_width="@dimen/keyguard_security_width"
77            android:layout_height="@dimen/pin_entry_height"
78            android:gravity="center"
79            android:focusedByDefault="true"
80            app:scaledTextSize="@integer/password_text_view_scale"
81            android:contentDescription="@string/keyguard_accessibility_pin_area" />
82
83        <View
84            android:id="@+id/divider"
85            android:layout_width="@dimen/keyguard_security_width"
86            android:layout_height="@dimen/divider_height"
87            android:background="@android:color/white" />
88
89        <TextView
90            android:layout_width="wrap_content"
91            android:layout_height="wrap_content"
92            android:layout_margin="@*android:dimen/car_padding_2"
93            android:gravity="center"
94            android:textColor="@android:color/white"
95            android:textSize="@*android:dimen/car_body1_size"
96            android:text="@string/keyguard_enter_your_pin" />
97
98        <include layout="@layout/keyguard_message_area" />
99
100        <Button
101            android:id="@+id/cancel_button"
102            android:layout_width="wrap_content"
103            android:layout_height="wrap_content"
104            android:layout_gravity="center"
105            style="@style/KeyguardButton"
106            android:text="@string/cancel"/>
107    </LinearLayout>
108
109    <!-- CarKeyguardPinView references these resources ids in code so removing them will cause the
110         keyguard to crash. Instead put them down here where they are out of the way and set their
111         visibility to gone. -->
112    <com.android.keyguard.AlphaOptimizedRelativeLayout
113        android:id="@+id/row0"
114        android:layout_width="0dp"
115        android:layout_height="0dp"
116        android:visibility="gone" />
117
118    <LinearLayout
119        android:id="@+id/row1"
120        android:layout_width="0dp"
121        android:layout_height="0dp"
122        android:visibility="gone" />
123
124    <LinearLayout
125        android:id="@+id/row2"
126        android:layout_width="0dp"
127        android:layout_height="0dp"
128        android:visibility="gone" />
129
130    <LinearLayout
131        android:id="@+id/row3"
132        android:layout_width="0dp"
133        android:layout_height="0dp"
134        android:visibility="gone" />
135
136    <LinearLayout
137        android:id="@+id/row4"
138        android:layout_width="0dp"
139        android:layout_height="0dp"
140        android:visibility="gone" />
141
142    <include layout="@layout/keyguard_eca"
143        android:id="@+id/keyguard_selector_fade_container"
144        android:layout_width="0dp"
145        android:layout_height="0dp"
146        android:visibility="gone"/>
147</com.android.systemui.car.keyguard.CarKeyguardPINView>
148