<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/discovery_layout"
  android:layout_height="match_parent"
  android:layout_width="match_parent"
  android:fitsSystemWindows="true"
  android:nextFocusDown="@+id/recycler_view"
  tools:context=".ui.activities.DiscoveryActivity">

  <RelativeLayout
    android:layout_marginTop="@dimen/discovery_drawer_status_bar_height_negative"
    android:paddingTop="@dimen/discovery_drawer_status_bar_height"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
      android:id="@+id/parent_app_bar"
      android:fitsSystemWindows="true"
      android:elevation="0dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      tools:ignore="UnusedAttribute">

      <include layout="@layout/discovery_toolbar"/>

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

    <android.support.design.widget.CoordinatorLayout
      android:elevation="4dp"
      android:layout_below="@id/parent_app_bar"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:ignore="UnusedAttribute">

      <android.support.design.widget.AppBarLayout
        android:id="@+id/discovery_sort_app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.design.widget.CollapsingToolbarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_scrollFlags="scroll|enterAlways">

          <com.kickstarter.ui.views.SortTabLayout
            android:id="@+id/discovery_tab_layout"
            app:tabMode="scrollable"
            app:tabIndicatorColor="@color/green"
            app:tabTextAppearance="@style/TabTextAppearance"
            app:tabTextColor="@color/black_alpha_30"
            app:tabSelectedTextColor="@color/text_primary"
            android:background="@drawable/click_indicator_light"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>

        </android.support.design.widget.CollapsingToolbarLayout>

        <include
          layout="@layout/horizontal_line_0_5dp_view"
          android:layout_height="wrap_content"
          android:layout_width="match_parent"
          android:layout_marginTop="@dimen/sort_tab_divider_margin_top_negative"
          app:layout_scrollFlags="scroll|enterAlways" />

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

      <android.support.v4.view.ViewPager
        android:id="@+id/discovery_view_pager"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:background="@color/discovery_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    </android.support.design.widget.CoordinatorLayout>

  </RelativeLayout>

  <android.support.design.widget.NavigationView
    android:id="@+id/discovery_navigation_view"
    android:layout_height="match_parent"
    android:layout_width="320dp"
    android:layout_gravity="start"
    android:fitsSystemWindows="true"
    android:background="@color/white">

    <android.support.v7.widget.RecyclerView
      android:id="@+id/discovery_drawer_recycler_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:scrollbars="vertical" />

  </android.support.design.widget.NavigationView>

</android.support.v4.widget.DrawerLayout>
