<?xml version="1.0" encoding="utf-8"?>
<layout 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">

    <data>

        <variable
            name="viewModel"
            type="com.yogeshpaliyal.keypass.ui.home.DashboardViewModel" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        tools:context=".ui.nav.DashboardActivity">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/searchAppBar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            app:elevation="0dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="@dimen/grid_2"
                android:layout_marginVertical="@dimen/grid_1"
                app:boxBackgroundColor="?attr/colorSurface"
                app:boxBackgroundMode="outline"
                app:boxCornerRadiusBottomEnd="@dimen/grid_1"
                app:boxCornerRadiusBottomStart="@dimen/grid_1"
                app:boxCornerRadiusTopEnd="@dimen/grid_1"
                app:boxCornerRadiusTopStart="@dimen/grid_1"
                app:hintAnimationEnabled="false"
                app:hintEnabled="false"
                app:endIconMode="clear_text">

                <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/search"
                    android:paddingTop="@dimen/grid_2"
                    android:paddingBottom="@dimen/grid_2"
                    android:text="@={viewModel.keyword}" />
            </com.google.android.material.textfield.TextInputLayout>

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

        <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintTop_toBottomOf="@id/searchAppBar">


            <fragment
                android:id="@+id/nav_host_fragment"
                android:name="androidx.navigation.fragment.NavHostFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:defaultNavHost="true"
                app:navGraph="@navigation/navigation_graph" />


            <androidx.fragment.app.FragmentContainerView
                android:id="@+id/bottom_nav_drawer"
                android:name="com.yogeshpaliyal.keypass.ui.nav.BottomNavDrawerFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />


            <com.google.android.material.bottomappbar.BottomAppBar
                android:id="@+id/bottomAppBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                app:fabAlignmentMode="center"
                app:fabCradleMargin="@dimen/bottom_app_bar_fab_cradle_margin"
                app:fabCradleRoundedCornerRadius="@dimen/bottom_app_bar_fab_cradle_corner_radius"
                app:hideOnScroll="true"
                app:menu="@menu/bottom_app_bar"
                app:navigationIcon="@drawable/ic_round_menu_24" />

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/btnAdd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_anchor="@id/bottomAppBar"
                app:srcCompat="@drawable/asl_add_save"
                app:shapeAppearanceOverlay="@style/ShapeAppearance.KeyPass.Cirle"/>


        </androidx.coordinatorlayout.widget.CoordinatorLayout>


    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>