In app, I've used a shape.xml for giving a rounded rectangle shape to my view (as seen below) and in that, I've used some color. Now, what I want to do is change the color in this shape.xml dynamically so that I can make some fade color animation out of it. So is there any way to change the color value in that file dynamically? Here is that file -
<?xml version="1.0" encoding="utf-8"?>
android:shape="rectangle">
<corners
android:radius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp" />
<size
android:width="65dp"
android:height="65dp" />
<solid
android:color="#FFA500" />
</shape>
Alternatively, can you suggest some dynamic code from which I can achieve the same that this shape.xml does, so that I can pass a color as a parameter over there?
Please Help.