<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?actionBarSize"
            app:navigationIcon="@drawable/ic_x_18dp"
            app:title="@string/set_link_create" />

    </com.google.android.material.appbar.AppBarLayout>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@id/save"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHeight_min="100dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/appBarLayout">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="16dp">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/textLayout"
                style="@style/Widget.Vector.TextInputLayout.Form"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:hint="@string/set_link_text">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/linkLayout"
                style="@style/Widget.Vector.TextInputLayout.Form"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:hint="@string/set_link_link">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/link"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textUri" />
            </com.google.android.material.textfield.TextInputLayout>

        </LinearLayout>
    </ScrollView>

    <Button
        android:id="@+id/save"
        style="@style/Widget.Vector.Button.CallToAction"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        android:height="56dp"
        android:text="@string/action_save"
        android:textAllCaps="false"
        app:iconGravity="textStart"
        app:layout_constraintBottom_toTopOf="@id/remove"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <Button
        android:id="@+id/remove"
        style="@style/Widget.Vector.Button.Destructive"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        android:height="56dp"
        android:text="@string/action_remove"
        android:textAllCaps="false"
        android:visibility="gone"
        app:iconGravity="textStart"
        app:layout_constraintBottom_toTopOf="@id/cancel"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:visibility="visible" />

    <Button
        android:id="@+id/cancel"
        style="@style/Widget.Vector.Button.Outlined"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="16dp"
        android:layout_marginBottom="8dp"
        android:height="56dp"
        android:text="@string/action_cancel"
        android:textAllCaps="false"
        app:iconGravity="textStart"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
