<!--
  ~ Copyright (C) 2019 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<com.android.systemui.biometrics.ui.CredentialPatternView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:elevation="@dimen/biometric_dialog_elevation"
    android:theme="?app:attr/lockPatternStyle">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/emergencyCallButton"
            android:orientation="vertical">

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1">

                <LinearLayout
                    style="?headerStyle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:paddingTop="0dp">

                    <ImageView
                        android:id="@+id/icon"
                        style="?headerIconStyle"
                        android:layout_gravity="center_horizontal"
                        android:contentDescription="@null"/>

                    <TextView
                        android:id="@+id/title"
                        style="?titleTextAppearance"
                        android:accessibilityHeading="true"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                    <TextView
                        android:id="@+id/subtitle"
                        style="?subTitleTextAppearance"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                    <TextView
                        android:id="@+id/description"
                        style="?descriptionTextAppearance"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                    <LinearLayout
                        android:id="@+id/customized_view_container"
                        android:orientation="vertical"
                        android:gravity="center_vertical"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp" />

                    <Button
                        android:id="@+id/fallback_button"
                        style="@style/AuthNonBioCredentialFallbackButtonStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:visibility="gone" />
                </LinearLayout>
            </ScrollView>

            <RelativeLayout
                android:id="@+id/auth_credential_container"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1.5"
                android:paddingBottom="48dp">

                <FrameLayout
                    android:layout_centerInParent="true"
                    style="?containerStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent">

                    <com.android.internal.widget.LockPatternView
                        android:id="@+id/lockPattern"
                        android:layout_gravity="center"
                        android:layout_width="@dimen/biometric_auth_pattern_view_size"
                        android:layout_height="@dimen/biometric_auth_pattern_view_size"
                        android:layout_marginBottom="32dp"/>

                    <TextView
                        android:id="@+id/error"
                        style="?errorTextAppearance"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal|bottom"
                        android:layout_marginBottom="8dp"/>
                </FrameLayout>
            </RelativeLayout>
        </LinearLayout>

        <Button
            android:id="@+id/emergencyCallButton"
            style="@style/AuthNonBioCredentialEmergencyButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:visibility="gone"
            android:layout_marginBottom="35dp"
            android:layout_centerHorizontal="true"
            android:text="@string/work_challenge_emergency_button_text"/>

        <ImageButton
            android:id="@+id/back_button"
            style="@style/AuthCredentialBackButton"
            android:layout_marginStart="24dp"
            android:src="@drawable/ic_arrow_back"
            android:contentDescription="@string/accessibility_back" />

    </RelativeLayout>
</com.android.systemui.biometrics.ui.CredentialPatternView>
