title: Android Drawable: Specifying shape width in percent in the XML file?
body: <p>I'm trying to create a simple Drawable that I want to set as the background for a view (using <em>setBackgroundDrawable</em>). I simply want to divide the background of the drawable into 2 equal rectangles (50% - 50%), the first want filled with black, the second with white:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:id="@+id/back_color_1"&gt;
          &lt;shape android:shape="rectangle"&gt;
            &lt;solid android:color="#000000" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
      &lt;item android:id="@+id/back_color_2"&gt;
          &lt;shape android:shape="rectangle"&gt;
            &lt;solid android:color="#FFFFFF" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>How can I specify that each shape should have a width of 50% in the drawable XML definition file? Something like <em>android:width="50%"</em>.</p>
  
  <p>(I'm working on Android 3.0, but I think it is a general Android question.)</p>
  
  <p>P.S: You can do this in CSS or XAML.</p>