I have a shape drawable in the drawable folder. Here is XML structure:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#4D0418"
android:centerColor="#5F031D"
android:endColor="#7D0227"
android:angle="-90" />
</shape>
Now I want to change the startColor, centerColor, endColor from the java code in the runtime. How it is possible to change?
Unfortunately there’s no API to do this. I’ll add one to a future Android release.