android - Adding a fading scrim to a CollapsingToolbarLayout -


how fading scrim on collapsingtoolbar layout's title?

i've set text size , color using app:expandedtitletextappearance attribute, can't figure out how give text background.

i know it's possible because can see whatsapp has done in group info screen.

the way have been able place view behind toolbar this:

<view      android:layout_width="match_parent"      android:layout_height="?attr/actionbarsize"      android:background="@drawable/shape_scrim"      android:layout_gravity="bottom"/>  <android.support.v7.widget.toolbar      android:id="@+id/toolbar"      android:layout_width="match_parent"      android:layout_height="?attr/actionbarsize"      app:popuptheme="@style/themeoverlay.appcompat.light"      app:layout_collapsemode="pin"/> 

with shape_scrim.xml looks this:

<shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient     android:angle="90"     android:endcolor="#00000000"     android:startcolor="#bb000000"/> </shape> 

Comments