<!--
  ~ 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:orientation="horizontal"
    android:elevation="@dimen/biometric_dialog_elevation"
    android:theme="?app:attr/lockPatternStyle">

    <RelativeLayout
        android:id="@+id/auth_credential_header"
        style="?headerStyle"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1">

        <ImageView
            android:id="@+id/icon"
            style="?headerIconStyle"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:contentDescription="@null"/>

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

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

        <TextView
            android:id="@+id/description"
            style="?descriptionTextAppearance"
            android:layout_below="@id/subtitle"
            android:layout_alignParentLeft="true"
            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_below="@id/subtitle"
            android:layout_alignParentLeft="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/error"
            style="?errorTextAppearanceLand"
            android:layout_below="@id/description"
            android:layout_alignParentLeft="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

    </RelativeLayout>

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

        <FrameLayout
            style="?containerStyle"
            android:layout_above="@id/emergencyCallButton"
            android:layout_width="match_parent"
            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"/>
        </FrameLayout>

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

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