I have the following action layout:
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout android:id="@+id/drawerLayout" style="@style/DrawerLayout" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".ui.activity.MyActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:background="@color/black" android:fitsSystemWindows="true" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:collapsedTitleTextAppearance="@style/ToolbarTitle" app:contentScrim="@color/primary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar_top" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" app:popupTheme="@style/AppTheme.PopupOverlay" app:theme="@style/ThemeOverlay.AppCompat.Light"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <my.package.ui.widget.MyHeaderWidget android:id="@+id/deal_header" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="my.package.ui.activity.MyHeaderBehavior"/> <include layout="@layout/content_list"/> </android.support.design.widget.CoordinatorLayout> <include layout="@layout/navigation_view"/> </android.support.v4.widget.DrawerLayout>
It is used to have a folding toolbar + navigation box + animation for the subtitle title (in the title widget). Everything is fine until I try to run ActionMode to enable multiscreen selection.
I do this by calling:
mActionMode = mCollapsingToolbarLayout.startActionMode(mActionModeCallback);
The problem is that I end up having two action panels (with two arrows):

Black, the one I expected there is added to white when I run ActionMode.
Am I doing something wrong?
EDIT
in AndroidMaifest
<activity android:name=".ui.activity.MyActivity" android:label="@string/title_activity" android:theme="@style/MyTheme"> </activity>
In styles.xml
<style name="MyTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:windowBackground">@drawable/window_background_gray</item> <item name="android:colorBackground">@color/app_background</item> <item name="displayOptions">showHome|homeAsUp|showTitle</item> <item name="android:icon">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="colorPrimary">@color/primary</item> <item name="colorAccent">@color/accent</item> <item name="colorPrimaryDark">@color/primaryDark</item> <item name="android:textAppearanceButton">@style/Theme.ButtonTextAppearance</item> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
EDIT2
If you want to test this problem, you can create a new project in Android studio using the ScrollingActivity example code. Change the theme as you think, and then just start the action mode when you press FAB, passing the following object as ActionMode.Callback to run SupportActionMode:
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() { // Called when the action mode is created; startActionMode() was called @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { // Inflate a menu resource providing context menu items MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.menu_scrolling, menu); return true; } // Called each time the action mode is shown. Always called after onCreateActionMode, but // may be called multiple times if the mode is invalidated. @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; // Return false if nothing is done } // Called when the user selects a contextual menu item @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { switch (item.getItemId()) { case R.id.action_settings: mode.finish(); return true; default: return false; } } // Called when the user exits the action mode @Override public void onDestroyActionMode(ActionMode mode) { mActionMode = null; } };