Android app xml resources with variable in it?

Is there a technique to implement the Android app xml resources with variable in it?

For example: I have a app resource, i.e., res/drawable/rounded_corners.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <solid android:color="@android:color/holo_blue_dark" />
    <corners android:radius="10dp" />
</shape>

It works, but I need to change the color in the runtime without creating a lot of similar resources like this just with different colors.



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation