<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <variable name="model" type="oppen.light.ui.editor.EditorViewModel"/>
    </data>

    <RelativeLayout
        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"
        tools:context=".ui.editor.EditorActivity">

        <RelativeLayout
            android:id="@+id/edit_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <oppen.light.views.TouchImageView
                android:id="@+id/preview_image_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/edit_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/semi_dark"
                app:titleMargin="0dp"
                app:menu="@menu/edit_menu">

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/open_new_image"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/open"
                    android:textFontWeight="200"
                    android:paddingLeft="6dp"
                    android:paddingRight="6dp"
                    android:paddingTop="8dp"
                    android:paddingBottom="8dp"
                    android:clickable="true"
                    android:focusable="true"
                    android:onClick="@{(v) -> model.open()}"
                    android:background="?attr/selectableItemBackground"
                    tools:targetApi="p" />
            </androidx.appcompat.widget.Toolbar>

            <androidx.appcompat.widget.LinearLayoutCompat
                android:id="@+id/controls"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:paddingTop="8dp"
                android:background="@color/controls_background"
                android:visibility="gone"
                android:orientation="vertical">

                <!-- Adjust -->
                <RelativeLayout
                    android:id="@+id/adjust_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <oppen.light.views.InertialSlider
                        android:id="@+id/inertial_slider"
                        android:layout_width="match_parent"
                        android:layout_height="40dp"
                        android:layout_below="@+id/options_recycler"/>

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/options_recycler"
                        android:layout_width="match_parent"
                        android:overScrollMode="never"
                        android:clipToPadding="false"
                        android:paddingStart="32dp"
                        android:paddingEnd="32dp"
                        android:layout_height="100dp" />
                </RelativeLayout>

                <!-- LUTS  -->
                <RelativeLayout
                    android:id="@+id/luts_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/luts_recycler"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        />

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/luts_brand_recycler"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/luts_recycler"
                        android:paddingTop="4dp"
                        android:paddingBottom="12dp"
                        />
                </RelativeLayout>

                <!-- Bottom chips -->
                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/controls_recycler"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingTop="12dp"
                    android:paddingBottom="12dp"
                    android:overScrollMode="never"
                    android:clipToPadding="false"
                     />
            </androidx.appcompat.widget.LinearLayoutCompat>
        </RelativeLayout>

        <FrameLayout
            android:id="@+id/empty_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:onClick="@{(v) -> model.open()}">
            <include layout="@layout/empty_layout" />
        </FrameLayout>


    </RelativeLayout>
</layout>