I have many XMLs that use background color from shape drawables like:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:background="@drawable/background"
/>
My shape background xml is:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:type="linear"
android:startColor="#FFffffff"
android:endColor="#FFE8E8E8"
android:angle="315" />
</shape>
Now I want to add a feature where I give the user the option to change the background color. Is there a quick way that I can change the source shape drawable based on some value instead of going to Each activity that loads xml and change that?
Thank you.