<?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">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@id/button_layout"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar_cheat_details"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar_cheat_details"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:navigationIcon="@drawable/ic_back"
                app:title="@string/cheats" />

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

        <androidx.core.widget.NestedScrollView
            android:id="@+id/scroll_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <LinearLayout
                android:id="@+id/input_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <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">

                    <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"
                        android:nextFocusDown="@id/edit_notes_input"
                        tools:text="Hyrule Field Speed Hack" />

                </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:layout_marginHorizontal="@dimen/spacing_large"
                    android:layout_marginBottom="24dp"
                    android:hint="@string/cheats_notes">

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

                </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">

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

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

            </LinearLayout>

        </androidx.core.widget.NestedScrollView>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <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" />

        <LinearLayout
            android:id="@+id/button_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent">

            <Button
                android:id="@+id/button_delete"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/spacing_large"
                android:layout_weight="1"
                android:nextFocusUp="@id/appbar_cheat_details"
                android:text="@string/cheats_delete" />

            <Button
                android:id="@+id/button_edit"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/spacing_large"
                android:layout_weight="1"
                android:nextFocusUp="@id/appbar_cheat_details"
                android:text="@string/cheats_edit" />

            <Button
                android:id="@+id/button_cancel"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/spacing_large"
                android:layout_weight="1"
                android:nextFocusUp="@id/edit_code_input"
                android:text="@android:string/cancel" />

            <Button
                android:id="@+id/button_ok"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/spacing_large"
                android:layout_weight="1"
                android:nextFocusUp="@id/edit_code_input"
                android:text="@android:string/ok" />

        </LinearLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
