material icon indicating copy to clipboard operation
material copied to clipboard

pink color on api 27

Open Mateeen opened this issue 7 years ago • 3 comments

on API 27 every widget have pink color in unchecked state switch checkbox how to fix this issue?

Mateeen avatar Aug 26 '18 09:08 Mateeen

See #445

eku avatar Aug 26 '18 10:08 eku

After lots of debugging, I think that I achieved a workaround to this problem. I was facing same problem in Spinner's underline color, that was pink too. Instead of using library default style, as shown below, I decided to create my own style that inherits from library's style then set color myself :

<com.rey.material.widget.Spinner
   android:id="@+id/spinnerPeriodo"
   style="@style/Material.Widget.Spinner"
   android:layout_width="match_parent"
   android:layout_height="50dp"
   android:layout_marginTop="@dimen/margin_20"
   app:rd_style="@style/Material.Drawable.Ripple.Wave" />

I found that "spn_dividerColor" attribute controls underline color, so in my style I can set the desired color:

    <style name="MySpinnerStyle" parent="Material.Widget.Spinner">
        <item name="spn_dividerColor">@color/accentColor</item>
    </style>

Therefore my advice is :

  • Try to find out which attribute controls view's component color;
  • Inherits parent's style values in your style file then set attribute with desired color

Another point is, if there's a problem in library, my guess would be that the problem probably has to do with the ThemeUtil file, used across various widgets and components to resolve colors to be set.

DanielGunna avatar Oct 18 '18 01:10 DanielGunna

@DanielGunna could one add the attribute to https://github.com/rey5137/material/blob/master/material/src/main/res/values/styles.xml and rebuild the librarry? Would this work? If yes, what about a PR?

eku avatar Oct 18 '18 07:10 eku