<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/createShortcutWrapper"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/scrim_background"
    android:fitsSystemWindows="true"
    tools:context="org.mozilla.fenix.shortcut.CreateShortcutFragment">
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginStart="32dp"
        android:layout_marginEnd="32dp"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="16dp"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"
        android:paddingStart="32dp"
        android:paddingEnd="0dp"
        android:background="@drawable/dialog_background">
        <TextView
            android:id="@+id/dialog_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="@style/HeaderTextStyle"
            android:textSize="20sp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            android:text="@string/add_to_homescreen_title"/>
        <ImageView
            android:id="@+id/favicon_image"
            android:importantForAccessibility="no"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_marginTop="32dp"
            app:layout_constraintTop_toBottomOf="@id/dialog_title"
            app:layout_constraintStart_toStartOf="parent"/>
        <EditText
            android:id="@+id/shortcut_text"
            android:inputType="text"
            android:importantForAutofill="no"
            android:hint="@string/add_to_homescreen_text_placeholder"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="32dp"
            android:backgroundTint="?neutral"
            app:layout_constraintStart_toEndOf="@id/favicon_image"
            app:layout_constraintTop_toTopOf="@id/favicon_image"
            app:layout_constraintBottom_toBottomOf="@id/favicon_image"
            app:layout_constraintEnd_toEndOf="parent"/>
        <Button
            android:id="@+id/add_button"
            style="@style/CreateShortcutDialogButton"
            android:background="?selectableItemBackground"
            android:layout_marginTop="32dp"
            android:layout_marginEnd="16dp"
            app:layout_constraintTop_toBottomOf="@id/shortcut_text"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:text="@string/add_to_homescreen_add"/>

        <Button
            android:id="@+id/cancel_button"
            style="@style/CreateShortcutDialogButton"
            android:background="?selectableItemBackground"
            android:text="@string/add_to_homescreen_cancel"
            app:layout_constraintBottom_toBottomOf="@id/add_button"
            app:layout_constraintEnd_toStartOf="@id/add_button" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
