<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    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">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="?android:toolbarStyle">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?actionBarSize"
            android:background="?colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <com.fastaccess.ui.widgets.FontEditText
                    android:id="@+id/searchEditText"
                    style="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:background="@color/transparent"
                    android:hint="@string/search"
                    android:imeOptions="actionSearch"
                    android:inputType="text"
                    android:maxLines="1"
                    android:textColorHint="?android:textColorSecondary"/>

                <com.fastaccess.ui.widgets.ForegroundImageView
                    android:id="@+id/clear"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:background="?selectableItemBackgroundBorderless"
                    android:contentDescription="@string/clear"
                    android:padding="@dimen/spacing_normal"
                    android:scaleType="centerCrop"
                    android:src="@drawable/ic_clear"
                    android:visibility="invisible"/>

                <android.support.v7.widget.AppCompatSpinner
                    android:id="@+id/searchOptions"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:entries="@array/files_search_options"/>
            </LinearLayout>


        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.AppBarLayout>

    <fragment
        android:id="@+id/filesFragment"
        android:name="com.fastaccess.ui.modules.search.code.SearchCodeFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/scroll_behavior"
        tools:layout="@layout/vertical_refresh_list"/>
</android.support.design.widget.CoordinatorLayout>