<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    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:orientation="vertical">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="?android:toolbarStyle">

            <androidx.appcompat.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="?actionBarSize"
                    android:layout_marginEnd="@dimen/spacing_normal"
                    android:orientation="horizontal">

                    <com.fastaccess.ui.widgets.FontAutoCompleteEditText
                        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:completionThreshold="1"
                        android:dropDownAnchor="@id/tabs"
                        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_micro"
                        android:src="@drawable/ic_clear"
                        android:visibility="gone"/>

                    <com.fastaccess.ui.widgets.ForegroundImageView
                        android:id="@+id/search"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:background="?selectableItemBackgroundBorderless"
                        android:contentDescription="@string/search"
                        android:padding="@dimen/spacing_micro"
                        android:src="@drawable/ic_search"/>

                </LinearLayout>
            </androidx.appcompat.widget.Toolbar>

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?colorPrimary"
                android:clipToPadding="false"
                android:paddingStart="@dimen/keyline_1"
                app:tabGravity="fill"
                app:tabMode="scrollable"
                app:tabSelectedTextColor="?colorAccent"
                app:tabTextColor="?android:textColorTertiary"
                tools:ignore="RtlSymmetry"/>
        </com.google.android.material.appbar.AppBarLayout>

        <com.fastaccess.ui.widgets.ViewPagerView
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/scroll_behavior"/>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <include layout="@layout/add_banner_layout"/>
</LinearLayout>