<?xml version="1.0" encoding="utf-8"?>

<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="256dp"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <com.google.android.material.appbar.CollapsingToolbarLayout
                android:id="@+id/collapsing_toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:contentScrim="?attr/colorPrimary"
                app:expandedTitleMarginEnd="24dp"
                app:expandedTitleMarginStart="50dp"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:layout_collapseMode="parallax"
                    app:layout_scrollFlags="scroll|enterAlways">

                    <androidx.viewpager.widget.ViewPager
                        android:id="@+id/view_pager"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone" />

                    <com.youth.banner.Banner
                        android:id="@+id/banner"
                        android:layout_width="match_parent"
                        android:layout_height="256dp"
                        app:banner_auto_loop="true"
                        app:banner_indicator_height="5dp"
                        app:banner_indicator_margin="5dp" />
                </RelativeLayout>

                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:layout_scrollFlags="scroll|enterAlways"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

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

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

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_news"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="vertical"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <LinearLayout
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/white"
        android:clickable="true"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:background="@color/colorPrimary"
            android:clickable="true"
            android:fitsSystemWindows="true"
            android:padding="16dp">

            <TextView
                android:id="@+id/iv_avatar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_above="@+id/tv_username"
                android:text="@string/app_name"
                android:textColor="@color/white"
                android:textSize="48sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/tv_username"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_marginTop="10dp"
                android:text="Unofficial Zhihu Daily"
                android:textColor="@android:color/white"
                android:textSize="16sp" />

        </RelativeLayout>

        <TextView
            android:id="@+id/tv_github"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/rv_selector"
            android:drawableLeft="@mipmap/ic_github"
            android:drawablePadding="32dp"
            android:gravity="center_vertical"
            android:padding="16dp"
            android:text="Github"
            android:textColor="@color/gray_middle"
            android:textSize="@dimen/font_size_middle" />
    </LinearLayout>

</androidx.drawerlayout.widget.DrawerLayout>