title: Diagonally spilliting background of a Relative Layout
body: <p>Hello all i want background of a layout as follows.</p>
  
  <p><img src="https://i.stack.imgur.com/fz0W8.png" alt="enter image description here"></p>
  
  <p>Now what i am doing is follows,</p>
  
  <pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;item
      android:drawable="@color/blue_new"&gt;
  &lt;/item&gt;
  
  &lt;item&gt;
      &lt;rotate
          android:fromDegrees="45"
          android:toDegrees="0"
          android:pivotX="0%"
          android:pivotY="100%" &gt;
          &lt;shape
              android:shape="rectangle"&gt;
              &lt;solid android:color="@color/white" /&gt;
  
          &lt;/shape&gt;
      &lt;/rotate&gt;
  &lt;/item&gt;
  
  &lt;item&gt;
      &lt;rotate
          android:fromDegrees="-45"
          android:toDegrees="0"
          android:pivotX="130%"
          android:pivotY="0%" &gt;
          &lt;shape
              android:shape="rectangle"&gt;
              &lt;solid android:color="@color/white" /&gt;
  
          &lt;/shape&gt;
      &lt;/rotate&gt;
  &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>Now i am partially getting what i want. If i remove third item, the rectangle is not reaching another end. Is there any other way to do it? Other then 9patch image? Can i dynamically calculate the pivotX and pivoty values of the second and third item? Or is there any other method to do so. </p>
  
  <p>Thanks.</p>