As you know, Elevation doesn't work on Pre-Lollipop devices. Because of this, the default App Bar in appcompat-v7 uses a "pseudo-shadow" texture, as I like to call it, to emulate the shadow. My problem is that I need to use a custom Toolbar. When I use the custom toolbar, that "pseudo-shadow" isn't present. So it just looks flat. Any idea how to add that shadow back? Some people have said on other forums to add a FrameLayout with a foreground of " android:windowContentOverlay" that somehow overlaps the ToolBar. I haven't found any way to get that working, sadly. And for some reason, in my testing, "android:windowContentOverlay" is invisible anyway. Not sure what I'm doing wrong. :/
Here's the Layout XML data for my Toolbar:
<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Here's what it looks like with the default AppCompat AppBar: https://i.stack.imgur.com/ELqA7.jpg
Here's what it looks like with a custom ToolBar: https://i.stack.imgur.com/o29Hu.jpg
Edit: With help from alanv, I figured out how to make a shadow beneath the Toolbar. However, it's not the same one that comes by default in AppCompat. It's only a faint shadow, and if I remember correctly it's the same shadow resource that had been used in older versions. I'm having a very hard time trying to find the resource for the default AppCompat bar.