You can use the Design support library.
Just add this dependency in your build.gradle
file:
compile 'com.android.support:design:23.1.0'
Then use something like this:
<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.AppBarLayout>
<android.support.v7.widget.Toolbar
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.design.widget.CoordinatorLayout>
The app:layout_behavior="@string/appbar_scrolling_view_behavior"
will add a behavior to the view, which can be listened by the AppBarLayout to animate its children.
The app:layout_scrollFlags="scroll|enterAlways"
line will cause that the Toolbar will scroll of the screen when user scrolls down the list.
You can find more info in the official blog.