I use my own library. In this library, I have identified some resources:
colors.xml (library)
<color name="colorPrimary">#000000</color>
In my application (which uses the above library). I want to override this color.
colors.xml (application)
<color name="colorPrimary">#ffffff</color>
I really want to override this attribute so that the library (and my application) uses the overridden rather than being declared from the library. It works fine, but Android Studio continues to shout: "Override @ color / colorPrimary, which is marked as private in my_lib. If you intend to use the tools: override =" true ", otherwise choose a different name." This makes me think that this is not a good approach.
I am also trying to add tools: override = "true" to the resource:
<resources xmlns:tools="http://schemas.android.com/tools" tools:override="true">
but the warning still exists.
Are there any errors in what I am doing? I cannot choose a different name because I want the library to use overridden values.
I am using Android Studio 2.1.1 and gradle 2.1.0.
Thanks.
source share