<?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:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/button_layout">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/edit_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="@dimen/spacing_large"
                android:layout_marginVertical="@dimen/spacing_small"
                android:hint="@string/cheats_name"
                android:paddingTop="@dimen/spacing_medlarge"
                app:errorEnabled="true"
                app:layout_constraintBottom_toTopOf="@id/edit_creator"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/edit_name_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:importantForAutofill="no"
                    android:inputType="text"
                    android:minHeight="48dp"
                    android:textAlignment="viewStart"
                    tools:text="Hyrule Field Speed Hack" />

            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/edit_creator"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/cheats_creator"
                android:layout_marginHorizontal="@dimen/spacing_large"
                android:layout_marginBottom="24dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/edit_name"
                app:layout_constraintBottom_toTopOf="@id/edit_notes">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/edit_creator_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="48dp"
                    android:importantForAutofill="no"
                    android:inputType="text"
                    android:textAlignment="viewStart" />

            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/edit_notes"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/cheats_notes"
                android:layout_marginHorizontal="@dimen/spacing_large"
                android:layout_marginBottom="24dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/edit_creator"
                app:layout_constraintBottom_toTopOf="@id/edit_code">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/edit_notes_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="48dp"
                    android:importantForAutofill="no"
                    android:inputType="textMultiLine"
                    android:textAlignment="viewStart" />

            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/edit_code"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="@dimen/spacing_large"
                android:layout_marginVertical="@dimen/spacing_small"
                android:hint="@string/cheats_code"
                app:errorEnabled="true"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/edit_notes">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/edit_code_input"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:minHeight="108sp"
                    android:importantForAutofill="no"
                    android:inputType="textMultiLine"
                    android:typeface="monospace"
                    android:gravity="start"
                    android:textAlignment="viewStart"
                    tools:text="0x8003d63c:dword:0x60000000\n0x8003d658:dword:0x60000000" />

            </com.google.android.material.textfield.TextInputLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </ScrollView>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/button_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        app:layout_constraintBottom_toBottomOf="parent">

        <com.google.android.material.divider.MaterialDivider
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/button_delete"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/spacing_large"
            android:text="@string/cheats_delete"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/button_edit"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/button_edit"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/spacing_large"
            android:text="@string/cheats_edit"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/button_cancel"
            app:layout_constraintStart_toEndOf="@id/button_delete"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/button_cancel"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/spacing_large"
            android:text="@string/cancel"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/button_ok"
            app:layout_constraintStart_toEndOf="@id/button_edit"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/button_ok"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/spacing_large"
            android:text="@string/ok"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/button_cancel"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
