Update
It seems that the library support team from Google presented the behavior as part of 24.0.0, but that seemed like an error, so now there is a new workaround that you need to make.
1 - Create appbar_always_elevated.xml in the animator-v21 folder in the res directory.
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <objectAnimator android:propertyName="elevation" android:valueTo="8dp" android:valueType="floatType" android:duration="1"/> </item> </selector>
2 - In the AppBarLayout application, use:
<android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="300dp" android:fitsSystemWindows="true" android:stateListAnimator="@animator/appbar_always_elevated" android:theme="@style/AppTheme.AppBarOverlay"> </android.support.design.widget.AppBarLayout>
Old answer
They fixed this as part of the new version of the support library (24), so you just need to update and use the correct property.
watch https://youtu.be/w45y_w4skKs?t=31m52s

Old answer
I solved this problem by having FrameLayout around the ViewPager and setting android:foreground .
Attached is the drawable that I use, and here is the link to gist

source share