rey5137 / material

A library to bring fully animated Material Design components to pre-Lolipop Android.
http://rey5137.com/material/
Apache License 2.0
6.01k stars 1.32k forks source link

pink color on api 27 #460

Open Mateeen opened 6 years ago

Mateeen commented 6 years ago

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

eku commented 6 years ago

See #445

DanielGunna commented 6 years ago

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 :

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.

eku commented 6 years ago

@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?