I know that there are several questions about styling the ActionMode of the action bar, but they are not exactly what I need.
I use a toolbar with a light theme and a dark action bar. The toolbar looks like I want, but the action mode looks like a normal dark theme. What do I need to change in my style to get a dark thematic mode of action (and not just the action bar)? It seems I have to do it quickly by clicking on Theme.AppCompat , as it shows the CAB as I want it, but I don't want the rest of the application to be dark.
I'm only interested in API 14+ and I use the support toolbar instead of the action bar.
Here is my basic style
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:actionModeBackground">@color/colorActionMode</item> <item name="android:windowActionModeOverlay">true</item> </style>
Toolbar style
<style name="AppTheme.Toolbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> <item name="android:textColorPrimary">@color/abc_primary_text_material_dark</item> <item name="actionMenuTextColor">@color/abc_primary_text_material_dark</item> <item name="android:textColorSecondary">@color/abc_primary_text_material_dark</item> <item name="android:background">@color/colorPrimaryDark</item> </style>
Toolbar layout file (installing popupTheme here seems to have no effect).
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?android:attr/actionBarSize" app:theme="@style/AppTheme.Toolbar" app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" android:popupTheme="@style/ThemeOverlay.AppCompat.Dark" android:elevation="2dp" android:focusable="false"/>
Here is my toolbar (this is how I want it)

Here is my ActionMode (which I need to invert)

This is what I want the ActionMode to look like (what I got by changing my style to inherit from Theme.AppCompat instead of Theme.AppCompat.Light.DarkActionBar . The problem is that the rest of the application has darkened, which I don't want.

android android-actionbar android-toolbar android-actionmode
Spencer
source share