Statusbar color changes on contextual Actionmode

Michael.4962Michael.4962 USMember ✭✭
edited March 2017 in Xamarin.Android

Hi
I have an issue with statusbar color. I changed styles.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <color name="colorPrimaryDark">#C85E20</color>
  <color name="colorPrimary">#DF891C</color>
  <color name="colorAccent">#DF891C</color>

  <style name="MainTheme" parent="MainTheme.Base">
  </style>
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">

    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <item name="colorAccent">@color/colorAccent</item>
    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight and colorSwitchThumbNormal. -->
    <item name="windowActionModeOverlay">true</item>

    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>

    <item name="actionModeStyle">@style/ContextActionMode</item>
  </style>

  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">@color/colorAccent</item>
  </style>

  <style name="ContextActionMode" parent="@style/Widget.AppCompat.ActionMode">
    <item name="background">@color/colorPrimaryDark</item>
  </style>  

</resources>

and the Toolbar.axml file is the following:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

now, the behavior in normal mode is right, statusbar in colorPrimaryDark as expected

but when I press and hold an item in a listview and contextual menu items appears, the statusbar become black:

other colors are correct......I don't know what I'm doing wrong :(

thanks to everyone can help me! :(

Answers

  • Michael.4962Michael.4962 USMember ✭✭

    any tips? i don't know how to solve this...

    maybe acting on toolbar.xml can help?

Sign In or Register to comment.