1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 ~ Copyright (C) 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 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 18 android:id="@+id/layout" 19 android:layout_width="match_parent" 20 android:layout_height="match_parent"> 21 22 <ImageView 23 android:id="@+id/background" 24 android:layout_width="match_parent" 25 android:layout_height="match_parent" 26 android:scaleType="center" /> 27 28 <LinearLayout 29 android:layout_width="match_parent" 30 android:layout_height="match_parent" 31 android:gravity="bottom" 32 android:background="@color/biometric_dialog_dim_color" 33 android:orientation="vertical"> 34 35 <!-- This is not a Space since Spaces cannot be clicked --> 36 <View 37 android:id="@+id/space" 38 android:layout_width="match_parent" 39 android:layout_height="0dp" 40 android:layout_weight="1" 41 android:contentDescription="@string/biometric_dialog_empty_space_description"/> 42 43 <ScrollView 44 android:layout_width="match_parent" 45 android:layout_height="wrap_content"> 46 47 <LinearLayout 48 android:layout_width="match_parent" 49 android:layout_height="wrap_content" 50 android:orientation="horizontal"> 51 52 <!-- This is not a Space since Spaces cannot be clicked. The width of this changes 53 depending on horizontal/portrait orientation --> 54 <View 55 android:id="@+id/left_space" 56 android:layout_weight="1" 57 android:layout_width="0dp" 58 android:layout_height="match_parent"/> 59 60 <LinearLayout 61 android:id="@+id/dialog" 62 android:layout_width="match_parent" 63 android:layout_height="wrap_content" 64 android:orientation="vertical" 65 android:background="@drawable/biometric_dialog_bg" 66 android:layout_marginBottom="@dimen/biometric_dialog_border_padding" 67 android:layout_marginLeft="@dimen/biometric_dialog_border_padding" 68 android:layout_marginRight="@dimen/biometric_dialog_border_padding"> 69 70 <TextView 71 android:id="@+id/title" 72 android:fontFamily="@*android:string/config_headlineFontFamilyMedium" 73 android:layout_width="match_parent" 74 android:layout_height="wrap_content" 75 android:layout_marginEnd="24dp" 76 android:layout_marginStart="24dp" 77 android:layout_marginTop="24dp" 78 android:gravity="@integer/biometric_dialog_text_gravity" 79 android:textSize="20sp" 80 android:textColor="?android:attr/textColorPrimary"/> 81 82 <TextView 83 android:id="@+id/subtitle" 84 android:layout_width="match_parent" 85 android:layout_height="wrap_content" 86 android:layout_marginTop="8dp" 87 android:layout_marginStart="24dp" 88 android:layout_marginEnd="24dp" 89 android:gravity="@integer/biometric_dialog_text_gravity" 90 android:textSize="16sp" 91 android:textColor="?android:attr/textColorPrimary"/> 92 93 <TextView 94 android:id="@+id/description" 95 android:layout_width="match_parent" 96 android:layout_height="wrap_content" 97 android:layout_marginEnd="24dp" 98 android:layout_marginStart="24dp" 99 android:gravity="@integer/biometric_dialog_text_gravity" 100 android:paddingTop="8dp" 101 android:textSize="16sp" 102 android:textColor="?android:attr/textColorPrimary"/> 103 104 <ImageView 105 android:id="@+id/biometric_icon" 106 android:layout_width="@dimen/biometric_dialog_biometric_icon_size" 107 android:layout_height="@dimen/biometric_dialog_biometric_icon_size" 108 android:layout_gravity="center_horizontal" 109 android:layout_marginTop="48dp" 110 android:scaleType="fitXY" /> 111 112 <TextView 113 android:id="@+id/error" 114 android:layout_width="match_parent" 115 android:layout_height="wrap_content" 116 android:layout_marginEnd="24dp" 117 android:layout_marginStart="24dp" 118 android:paddingTop="16dp" 119 android:paddingBottom="24dp" 120 android:textSize="12sp" 121 android:gravity="center_horizontal" 122 android:accessibilityLiveRegion="polite" 123 android:textColor="@color/biometric_dialog_gray"/> 124 125 <LinearLayout 126 android:layout_width="match_parent" 127 android:layout_height="72dip" 128 android:paddingTop="24dp" 129 android:layout_gravity="center_vertical" 130 style="?android:attr/buttonBarStyle" 131 android:orientation="horizontal" 132 android:measureWithLargestChild="true"> 133 <Space android:id="@+id/leftSpacer" 134 android:layout_width="12dp" 135 android:layout_height="match_parent" 136 android:visibility="visible" /> 137 <!-- Negative Button --> 138 <Button android:id="@+id/button2" 139 android:layout_width="wrap_content" 140 android:layout_height="match_parent" 141 style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored" 142 android:gravity="center" 143 android:maxLines="2" /> 144 <Space android:id="@+id/middleSpacer" 145 android:layout_width="0dp" 146 android:layout_height="match_parent" 147 android:layout_weight="1" 148 android:visibility="visible" /> 149 <!-- Positive Button --> 150 <Button android:id="@+id/button1" 151 android:layout_width="wrap_content" 152 android:layout_height="match_parent" 153 style="@*android:style/Widget.DeviceDefault.Button.Colored" 154 android:gravity="center" 155 android:maxLines="2" 156 android:text="@string/biometric_dialog_confirm" 157 android:visibility="gone"/> 158 <!-- Try Again Button --> 159 <Button android:id="@+id/button_try_again" 160 android:layout_width="wrap_content" 161 android:layout_height="match_parent" 162 style="@*android:style/Widget.DeviceDefault.Button.Colored" 163 android:gravity="center" 164 android:maxLines="2" 165 android:text="@string/biometric_dialog_try_again" 166 android:visibility="gone"/> 167 <Space android:id="@+id/rightSpacer" 168 android:layout_width="12dip" 169 android:layout_height="match_parent" 170 android:visibility="visible" /> 171 </LinearLayout> 172 </LinearLayout> 173 174 <!-- This is not a Space since Spaces cannot be clicked. The width of this changes 175 depending on horizontal/portrait orientation --> 176 <View 177 android:id="@+id/right_space" 178 android:layout_weight="1" 179 android:layout_width="0dp" 180 android:layout_height="match_parent" /> 181 182 </LinearLayout> 183 184 </ScrollView> 185 186 </LinearLayout> 187 188 </FrameLayout> 189