|
<?xml version="1.0" encoding="utf-8"?> |
|
<android.support.design.widget.CoordinatorLayout |
|
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.support.design.widget.AppBarLayout |
|
android:layout_width="match_parent" |
|
android:layout_height="wrap_content"> |
|
|
|
<android.support.v7.widget.Toolbar |
|
android:id="@+id/toolbar" |
|
android:layout_width="match_parent" |
|
android:layout_height="wrap_content" |
|
android:theme="@style/ToolbarOverlayTheme" |
|
app:layout_scrollFlags="scroll|enterAlways" |
|
app:title="Tab one"/> |
|
|
|
</android.support.design.widget.AppBarLayout> |
|
|
|
<android.support.v7.widget.RecyclerView |
|
android:id="@+id/itemList" |
|
android:layout_width="match_parent" |
|
android:layout_height="match_parent" |
|
android:background="#c2c2c2" |
|
app:layoutManager="android.support.v7.widget.LinearLayoutManager" |
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"/> |
|
|
|
<android.support.design.widget.BottomNavigationView |
|
android:id="@+id/navigation" |
|
android:layout_width="match_parent" |
|
android:layout_height="wrap_content" |
|
android:layout_gravity="bottom" |
|
android:background="#FFFFFF" |
|
app:layout_behavior="com.bottomnav.example.BottomNavigationBehavior" |
|
app:menu="@menu/my_menu"/> |
|
|
|
</android.support.design.widget.CoordinatorLayout> |
we can just add the app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior" to bottom navigattion view here.
But if the recyclerview is in some fragment that is inside a view pager of the main layout. and the fragment has a collapsingtoolbar of its own. how manage the scrolling of the bottom nav view ?