ActionMode style override the main ActionBar in my android app



I'm building an Android app with AppCompat Theme but I have a problem to set my ActionMode theme in my app. I'm trying to add a new style for this but it seems override the main actionbar and I don't know why...


This is the main Actionbar:


enter image description here


When I try to copy a text...


enter image description here


This is my actionbar layout:



<android.support.v7.widget.Toolbar
xmlns:app="http://ift.tt/GEGVYd"
xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:theme="@style/ActionBarThemeOverlay"
app:popupTheme="@style/PopupMenuStyle">


And finally, this is my style.xml:



<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:textColorPrimary">#808080</item>
<item name="windowActionModeOverlay">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:spinnerItemStyle">@style/Spinner.spnItem</item>
<item name="android:spinnerDropDownItemStyle">@style/Spinner.spnItemDropDown</item>
<item name="colorAccent">@color/primarycolor</item>
<item name="actionModeStyle">@style/ActionModeStyle</item>
</style>

<style name="ActionBarThemeOverlay" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:textColorPrimary">@color/white</item>
<item name="android:textColorSecondary">@color/white</item>
<item name="colorControlNormal">#fff</item>
<item name="colorControlHighlight">#fff</item>
<item name="android:background">@color/primarycolor</item>
</style>

<style name="PopupMenuStyle">
<item name="android:background">@color/white</item>
<item name="android:popupBackground">@color/white</item>
<item name="android:textColorPrimary">@android:color/black</item>
</style>

<style name="ActionModeStyle">
<item name="android:colorBackground">@color/primarycolor</item>
</style>


I'm loosing my mind...


What am I doing wrong?


Thanks!


No comments:

Post a Comment