<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
    android:id="@+id/drawer"
    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:fitsSystemWindows="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:focusableInTouchMode="true"
        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"
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="?android:toolbarStyle">

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

                <androidx.appcompat.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="?colorPrimary"
                    android:minHeight="?actionBarSize"
                    android:theme="?android:toolbarStyle">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:padding="@dimen/spacing_normal">

                        <com.fastaccess.ui.widgets.FontTextView
                            android:id="@+id/changes"
                            style="@style/TextAppearance.AppCompat.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:layout_marginEnd="@dimen/spacing_xs_large"
                            android:background="?selectableItemBackgroundBorderless"
                            android:drawablePadding="@dimen/spacing_micro"
                            android:drawableTop="@drawable/ic_file_multi"
                            android:gravity="center"
                            tools:text="100"/>

                        <com.fastaccess.ui.widgets.FontTextView
                            android:id="@+id/addition"
                            style="@style/TextAppearance.AppCompat.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:layout_marginEnd="@dimen/spacing_xs_large"
                            android:background="?selectableItemBackgroundBorderless"
                            android:drawablePadding="@dimen/spacing_micro"
                            android:drawableTop="@drawable/ic_add"
                            android:gravity="center"
                            android:scaleType="centerCrop"
                            tools:text="100"/>

                        <com.fastaccess.ui.widgets.FontTextView
                            android:id="@+id/deletion"
                            style="@style/TextAppearance.AppCompat.Small"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center|end"
                            android:background="?selectableItemBackgroundBorderless"
                            android:drawablePadding="@dimen/spacing_micro"
                            android:drawableTop="@drawable/ic_clear"
                            android:gravity="center"
                            tools:text="100"/>
                    </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"
                    app:tabSelectedTextColor="?colorAccent"
                    app:tabTextColor="?android:textColorTertiary"/>
            </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.cardview.widget.CardView
                android:id="@+id/prReviewHolder"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/fab_margin"
                android:layout_marginEnd="@dimen/fab_spacing"
                android:layout_marginStart="@dimen/fab_margin"
                android:layout_marginTop="@dimen/fab_margin"
                android:focusable="true"
                android:visibility="gone"
                app:cardBackgroundColor="?colorAccent"
                app:contentPadding="@dimen/spacing_normal"
                app:layout_anchor="@+id/fab"
                app:layout_anchorGravity="start|center"
                tools:visibility="visible">

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

                    <com.fastaccess.ui.widgets.FontTextView
                        android:id="@+id/reviewsCount"
                        style="@style/TextAppearance.AppCompat.Small"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:background="@drawable/circle_shape"
                        android:backgroundTint="?colorPrimary"
                        android:gravity="center"
                        android:minHeight="24dp"
                        android:minWidth="24dp"
                        android:padding="@dimen/spacing_micro"
                        tools:text="1"/>

                    <com.fastaccess.ui.widgets.FontTextView
                        style="@style/TextAppearance.AppCompat.Small"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_marginStart="@dimen/spacing_normal"
                        android:layout_weight="1"
                        android:text="@string/pull_request_reviews"/>

                    <com.fastaccess.ui.widgets.FontTextView
                        android:id="@+id/submitReviews"
                        style="@style/Widget.AppCompat.ButtonBar"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:background="?selectableItemBackgroundBorderless"
                        android:padding="@dimen/spacing_normal"
                        android:text="@string/submit"
                        android:textAppearance="@style/TextAppearance.AppCompat.Small"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="end|bottom"
                android:layout_margin="@dimen/fab_margin"
                android:src="@drawable/ic_comment"
                android:tint="@color/white"
                app:fabSize="auto"/>

        </androidx.coordinatorlayout.widget.CoordinatorLayout>

        <fragment
            android:id="@+id/commentFragment"
            android:name="com.fastaccess.ui.modules.editor.comment.CommentEditorFragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:layout="@layout/comment_box_layout"/>
    </LinearLayout>

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

</androidx.drawerlayout.widget.DrawerLayout>