1<!--
2  ~ Copyright (C) 2023 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
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<com.android.systemui.biometrics.ui.BiometricPromptLayout
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    android:id="@+id/contents"
19    android:layout_width="wrap_content"
20    android:layout_height="wrap_content"
21    android:orientation="vertical">
22
23    <ImageView
24        android:id="@+id/logo"
25        android:layout_width="@dimen/biometric_auth_icon_size"
26        android:layout_height="@dimen/biometric_auth_icon_size"
27        android:layout_gravity="center"
28        android:scaleType="fitXY"/>
29
30    <TextView
31        android:id="@+id/logo_description"
32        android:layout_width="match_parent"
33        android:layout_height="wrap_content"
34        android:gravity="@integer/biometric_dialog_text_gravity"
35        android:singleLine="true"
36        android:marqueeRepeatLimit="1"
37        android:ellipsize="marquee"/>
38
39    <TextView
40        android:id="@+id/title"
41        android:layout_width="match_parent"
42        android:layout_height="wrap_content"
43        android:gravity="@integer/biometric_dialog_text_gravity"
44        android:singleLine="true"
45        android:marqueeRepeatLimit="1"
46        android:ellipsize="marquee"
47        style="@style/TextAppearance.AuthCredential.OldTitle"/>
48
49    <TextView
50        android:id="@+id/subtitle"
51        android:layout_width="match_parent"
52        android:layout_height="wrap_content"
53        android:gravity="@integer/biometric_dialog_text_gravity"
54        android:singleLine="true"
55        android:marqueeRepeatLimit="1"
56        android:ellipsize="marquee"
57        style="@style/TextAppearance.AuthCredential.OldSubtitle"/>
58
59    <TextView
60        android:id="@+id/description"
61        android:layout_width="match_parent"
62        android:layout_height="wrap_content"
63        android:gravity="@integer/biometric_dialog_text_gravity"
64        android:scrollbars ="vertical"
65        android:importantForAccessibility="no"
66        style="@style/TextAppearance.AuthCredential.OldDescription"/>
67
68    <Space
69        android:id="@+id/space_above_content"
70        android:layout_width="match_parent"
71        android:layout_height="24dp"
72        android:visibility="gone" />
73
74    <LinearLayout
75        android:id="@+id/customized_view_container"
76        android:layout_width="match_parent"
77        android:layout_height="wrap_content"
78        android:fadeScrollbars="false"
79        android:gravity="center_vertical"
80        android:orientation="vertical"
81        android:scrollbars="vertical"
82        android:visibility="gone" />
83
84    <Space android:id="@+id/space_above_icon"
85        android:layout_width="match_parent"
86        android:layout_height="48dp" />
87
88    <FrameLayout
89        android:id="@+id/biometric_icon_frame"
90        android:layout_width="wrap_content"
91        android:layout_height="wrap_content"
92        android:layout_gravity="center">
93
94        <com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
95            android:id="@+id/biometric_icon"
96            android:layout_width="wrap_content"
97            android:layout_height="wrap_content"
98            android:layout_gravity="center"
99            android:contentDescription="@null"
100            android:scaleType="fitXY" />
101
102        <com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
103            android:id="@+id/biometric_icon_overlay"
104            android:layout_width="wrap_content"
105            android:layout_height="wrap_content"
106            android:layout_gravity="center"
107            android:contentDescription="@null"
108            android:scaleType="fitXY" />
109    </FrameLayout>
110
111    <!-- For sensors such as UDFPS, this view is used during custom measurement/layout to add extra
112         padding so that the biometric icon is always in the right physical position. -->
113    <Space android:id="@+id/space_below_icon"
114        android:layout_width="match_parent"
115        android:layout_height="12dp" />
116
117    <TextView
118        android:id="@+id/indicator"
119        android:layout_width="match_parent"
120        android:layout_height="wrap_content"
121        android:paddingHorizontal="24dp"
122        android:textSize="12sp"
123        android:gravity="center_horizontal"
124        android:accessibilityLiveRegion="polite"
125        android:singleLine="true"
126        android:ellipsize="marquee"
127        android:marqueeRepeatLimit="marquee_forever"
128        android:scrollHorizontally="true"
129        android:fadingEdge="horizontal"
130        android:textColor="@color/biometric_dialog_gray"/>
131
132    <LinearLayout
133        android:id="@+id/button_bar"
134        android:layout_width="match_parent"
135        android:layout_height="88dp"
136        style="?android:attr/buttonBarStyle"
137        android:orientation="horizontal"
138        android:paddingTop="24dp">
139
140        <Space android:id="@+id/leftSpacer"
141            android:layout_width="8dp"
142            android:layout_height="match_parent"
143            android:visibility="visible" />
144
145        <!-- Negative Button, reserved for app -->
146        <Button android:id="@+id/button_negative"
147            android:layout_width="wrap_content"
148            android:layout_height="wrap_content"
149            style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
150            android:layout_gravity="center_vertical"
151            android:ellipsize="end"
152            android:maxLines="2"
153            android:maxWidth="@dimen/biometric_dialog_button_negative_max_width"
154            android:visibility="gone"/>
155        <!-- Cancel Button, replaces negative button when biometric is accepted -->
156        <Button android:id="@+id/button_cancel"
157            android:layout_width="wrap_content"
158            android:layout_height="wrap_content"
159            style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
160            android:layout_gravity="center_vertical"
161            android:maxWidth="@dimen/biometric_dialog_button_negative_max_width"
162            android:text="@string/cancel"
163            android:visibility="gone"/>
164        <!-- "Use Credential" Button, replaces if device credential is allowed -->
165        <Button android:id="@+id/button_use_credential"
166            android:layout_width="wrap_content"
167            android:layout_height="wrap_content"
168            style="@*android:style/Widget.DeviceDefault.Button.Borderless.Colored"
169            android:layout_gravity="center_vertical"
170            android:maxWidth="@dimen/biometric_dialog_button_negative_max_width"
171            android:visibility="gone"/>
172
173        <Space android:id="@+id/middleSpacer"
174            android:layout_width="0dp"
175            android:layout_height="match_parent"
176            android:layout_weight="1"
177            android:visibility="visible"/>
178
179        <!-- Positive Button -->
180        <Button android:id="@+id/button_confirm"
181            android:layout_width="wrap_content"
182            android:layout_height="wrap_content"
183            style="@*android:style/Widget.DeviceDefault.Button.Colored"
184            android:layout_gravity="center_vertical"
185            android:ellipsize="end"
186            android:maxLines="2"
187            android:maxWidth="@dimen/biometric_dialog_button_positive_max_width"
188            android:text="@string/biometric_dialog_confirm"
189            android:visibility="gone"/>
190        <!-- Try Again Button -->
191        <Button android:id="@+id/button_try_again"
192            android:layout_width="wrap_content"
193            android:layout_height="wrap_content"
194            style="@*android:style/Widget.DeviceDefault.Button.Colored"
195            android:layout_gravity="center_vertical"
196            android:ellipsize="end"
197            android:maxLines="2"
198            android:maxWidth="@dimen/biometric_dialog_button_positive_max_width"
199            android:text="@string/biometric_dialog_try_again"
200            android:visibility="gone"/>
201
202        <Space android:id="@+id/rightSpacer"
203            android:layout_width="8dp"
204            android:layout_height="match_parent"
205            android:visibility="visible" />
206    </LinearLayout>
207
208</com.android.systemui.biometrics.ui.BiometricPromptLayout>
209