I use the new Toolbar with a Contextual Action Bar. When I used the appcompat-v7:22.0.0 library, everything works fine when selecting a list item. But after updating to 22.1.1 and refactoring my ActionBarActivity to the new AppCompatActivity, the CAB does not keep its colors on devices with API < 21.
With appcompat v7:22.0.0 it looked like this (and on API 21, it still does):
With appcompat v7:22.1.1 and API 19, it looks like this (smaller size is ok because of different device size):
My toolbar.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:theme="@style/ToolBarStyle"/>
and this is my themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionModeOverlay">true</item>
</style>
<style name="AppTheme" parent="AppTheme.Base"/>
<!-- ToolBar -->
<style name="ToolBarStyle" parent="Theme.AppCompat">
<item name="android:background">@color/hero_blue</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="actionMenuTextColor">@android:color/white</item>
<item name="actionModeBackground">@color/hero_blue</item>
<item name="android:textSize">12sp</item>
</style>
</resources>