<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
    tools:context="com.nauk.coinfolio.Activities.HomeActivity">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <android.support.design.widget.AppBarLayout
            android:id="@+id/app_bar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/app_bar_height"
            android:fitsSystemWindows="true"
            android:theme="@style/AppTheme.AppBarOverlay"
            android:background="@drawable/gradient_background"
            android:elevation="10dp">

            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/toolbar_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                app:contentScrim="@drawable/gradient_background"
                app:layout_scrollFlags="scroll|exitUntilCollapsed"
                app:toolbarId="@+id/toolbar"
                app:collapsedTitleGravity="center"
                app:expandedTitleGravity="center"
                app:titleEnabled="true">

                <TextView
                    android:id="@+id/toolbarSubtitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center|bottom"
                    android:layout_marginBottom="35dp"
                    android:gravity="center"
                    android:textSize="20sp"
                    app:layout_collapseMode="parallax"/>

                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/AppTheme.PopupOverlay"
                    android:layout_marginStart="-30dp">

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

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_collapseMode="pin"
                    android:layout_margin="10dp">

                    <ImageButton
                        android:id="@+id/switch_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/quick_button"
                        android:visibility="visible"
                        android:layout_gravity="start"/>

                    <ImageButton
                        android:id="@+id/settings_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/action_settings"
                        android:visibility="visible"
                        android:layout_gravity="end"/>

                </FrameLayout>

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

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

        <com.luseen.spacenavigation.SpaceNavigationView
            android:id="@+id/space"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="bottom"/>

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

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/floatingAddButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="0dp"
        app:borderWidth="0dp"
        android:backgroundTint="@color/colorPrimary"
        android:background="@color/cardview_light_background"
        android:src="@drawable/ic_add_white_24dp"
        android:layout_gravity="bottom|center_horizontal"
        android:clickable="true"
        android:focusable="true"
        android:layout_margin="8dp"
        android:visibility="visible"/>

</FrameLayout>