<!--
  ~ 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.
  -->

<merge xmlns:android="http://schemas.android.com/apk/res/android">

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

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

            <RelativeLayout
                style="?headerStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingTop="24dp">

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

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

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

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

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

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

    </FrameLayout>

    <RelativeLayout
        android:id="@+id/auth_credential_input"
        android:paddingHorizontal="24dp"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="80dp"
            android:orientation="vertical">

            <ImeAwareEditText
                android:id="@+id/lockPassword"
                android:layout_width="match_parent"
                android:layout_height="56dp"
                android:layout_gravity="center_horizontal"
                android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
                android:inputType="textPassword"
                android:paddingStart="12dp"
                android:paddingEnd="12dp"
                style="@style/Widget.AuthCredential.Password"/>

            <TextView
                android:id="@+id/error"
                style="?errorTextAppearance"
                android:layout_gravity="center_horizontal"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        </LinearLayout>

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

</merge>
