title: How to change rectangle color in xml layout
body: <p>My current approach:</p>
  
  <p>I create Rectangle in separate file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt;
       &lt;solid&gt;@color/red&lt;/solid&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>And later I reference it in my layout like this:</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/rectimage"
      android:layout_width="17dp"
      android:layout_height="17dp"
      android:src="@drawable/rectangle"&gt;
  &lt;/ImageView&gt;
  </code></pre>
  
  <p>How to change the color in xml layout? I'd like to have different color for each rectangle, but I don't want to create separate drawable files for each of them.</p>