<?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:id="@+id/coordinator_main"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorSurface"
        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_cheats"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:elevation="0dp"
            app:liftOnScroll="false">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar_cheats"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/colorSurface" />

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

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <androidx.slidingpanelayout.widget.SlidingPaneLayout
        android:id="@+id/sliding_pane_layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="?attr/colorSurface"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/coordinator_main">

        <androidx.fragment.app.FragmentContainerView
            android:id="@+id/cheat_list"
            android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatListFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:layout="@layout/fragment_cheat_list" />

        <androidx.fragment.app.FragmentContainerView
            android:id="@+id/cheat_details"
            android:name="org.dolphinemu.dolphinemu.features.cheats.ui.CheatDetailsFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:layout="@layout/fragment_cheat_details" />

    </androidx.slidingpanelayout.widget.SlidingPaneLayout>

    <!-- We have to set the layout height at 1px because when a device forces fullscreen mode,
         inset callbacks are not triggered and using 0dp will make this view cover the entire
         display since this activity uses a constraint layout. Now, even if the callback isn't
         triggered, this view will remain at 1px height. -->
    <View
        android:id="@+id/workaround_view"
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_gravity="bottom"
        android:background="@android:color/transparent"
        android:clickable="true"
        android:focusable="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
