Может ли это быть реализовано: Панель инструментов в NavigationView с помощью CoordinatorLayout
Правильный ли код?
Пожалуйста, дайте мне пример и помогите мне сделать это
Смотрите фото для лучшего понимания
фотография
activity_main.xml
<!-- notation start -->
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout >
<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.AppBarLayout>
<android.support.design.widget.CollapsingToolbarLayout>
<ImageView/>
<android.support.v7.widget.Toolbar>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- content -->
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton/>
</android.support.design.widget.CoordinatorLayout>
<!-- notation end-->
<!-- NavigationView -->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_activity_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
nav_header_activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.AppBarLayout>
<android.support.design.widget.CollapsingToolbarLayout>
<ImageView/><!-- background Toolbar-->
<android.support.v7.widget.Toolbar>
<!-- app:layout_collapseMode="pin" -->
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- START content NavigationView header -->
<LinearLayout>
<ImageView/>
<TextView/>
<TextView/>
</LinearLayout>
<!--END content NavigationView header -->
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton/>
</android.support.design.widget.CoordinatorLayout>
Меню / activity_main_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item/>
<item/>
</group>
<item android:title="Communicate">
<menu>
<item/>
<item/>
</menu>
</item>
<!-- 20 item in menu -->
</menu>
Любая помощь будет оценена. Спасибо.