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="@android:color/white" /> 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:textColor="@android:color/white" 106 android:textSize="@*android:dimen/car_body1_size" 107 android:text="@string/car_keyguard_enter_your_pin" /> 108 109 <include layout="@layout/keyguard_message_area" /> 110 111 <Button 112 android:id="@+id/cancel_button" 113 android:layout_width="wrap_content" 114 android:layout_height="wrap_content" 115 android:layout_gravity="center" 116 style="@style/KeyguardButton" 117 android:text="@string/cancel"/> 118 </LinearLayout> 119 120 <!-- CarKeyguardPinView references these resources ids in code so removing them will cause the 121 keyguard to crash. Instead put them down here where they are out of the way and set their 122 visibility to gone. --> 123 <com.android.keyguard.AlphaOptimizedRelativeLayout 124 android:id="@+id/row0" 125 android:layout_width="0dp" 126 android:layout_height="0dp" 127 android:visibility="gone" /> 128 129 <LinearLayout 130 android:id="@+id/row1" 131 android:layout_width="0dp" 132 android:layout_height="0dp" 133 android:visibility="gone" /> 134 135 <LinearLayout 136 android:id="@+id/row2" 137 android:layout_width="0dp" 138 android:layout_height="0dp" 139 android:visibility="gone" /> 140 141 <LinearLayout 142 android:id="@+id/row3" 143 android:layout_width="0dp" 144 android:layout_height="0dp" 145 android:visibility="gone" /> 146 147 <LinearLayout 148 android:id="@+id/row4" 149 android:layout_width="0dp" 150 android:layout_height="0dp" 151 android:visibility="gone" /> 152 153 <include layout="@layout/keyguard_eca" 154 android:id="@+id/keyguard_selector_fade_container" 155 android:layout_width="0dp" 156 android:layout_height="0dp" 157 android:visibility="gone" /> 158</com.android.systemui.car.keyguard.CarKeyguardPINView> 159