Skip to content

Instantly share code, notes, and snippets.

@ValCanBuild
Last active January 25, 2024 12:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ValCanBuild/abcaf45b430c9821db95b68575b53cc3 to your computer and use it in GitHub Desktop.
Save ValCanBuild/abcaf45b430c9821db95b68575b53cc3 to your computer and use it in GitHub Desktop.
<?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>
@sagarnayak
Copy link

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 ?

@Naveen-Shah01
Copy link

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 ?

hey did you find out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment