Is there a simple way to outline views with a border in some color when you run an app to see how the position and size is for the views? Like you could outline elements on a webpage in firefox with the addon "web developer".
Right now I have some "shape drawable" xml files for different colors that I use on different views. But its not optimal to need to add and remove all these shape drawable to the views in the layout xml files just to turn the outline on and off.
One solution I though of that maybe could work (but suppose there is better ways) is, if it is possible to add all "shape:s" in one single xml and still be able to "link" to each separate from the layout xml files? In that case I could just have two xml files, one with the "stroke" in the "shape", and one without (just empty "shape:s") and just change the name between them, to turn outlining on and off.
Right now every shape file looks like this (ex drawable/test_border_red.xml)
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="#ff0000"
/>
<padding
android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
</shape>
and then adding...
android:background="@drawable/test_border_red"
to each interesting view in the layout xml file.
If its possible to have all "shape" in one xml file, how should the code look like?