I've been using the following method to add a border to the top of a view:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#b7b7b7" />
</shape>
</item>
<item android:top="1px" >
<shape android:shape="rectangle">
<solid android:color="#5f5f5f" />
</shape>
</item>
</layer-list>
The above gets specified in its own xml file within the drawable folder, then set as the background on the view where I want the border to appear.
Now, the problem here is that this border is "hard coded" to a specific background color. Whichever view I apply it on, the background color will be changed to #5f5f5f.
I want to be able to set any background color, then apply a border. In other words, I can have a red view, a green view, and a blue view. Suppose I want to place the same border on top of each one. Is there a way to do this without making 3 copies of the above xml file and changing the color in each one?