title: Draw custom drawable shape in android
body: <p>I want to draw a custom shape in <code>xml</code> layout like below :</p>
  
  <p><a href="https://i.stack.imgur.com/nfzXS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nfzXS.png" alt="enter image description here"></a></p>
  
  <p>I tried to do some code in <code>XML</code> but i do not understand how to give shadow effect to outline of this shadow.</p>
  
  <p>What i did : </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:width="20dp"
          android:height="20dp"
          android:gravity="top|left"&gt;
          &lt;rotate
              android:fromDegrees="45"
              android:pivotX="50%"
              android:pivotY="50%"
              android:toDegrees="45"&gt;
              &lt;shape android:shape="rectangle"&gt;
  
                  &lt;corners android:bottomRightRadius="2dp"/&gt;
  
                  &lt;gradient android:type="linear" android:angle="270" android:startColor="#ffffff" android:endColor="#ffffff"/&gt;
              &lt;/shape&gt;
  
          &lt;/rotate&gt;
      &lt;/item&gt;
      &lt;item
          android:width="120dp"
          android:height="36dp"
          android:bottom="6dp"&gt;
          &lt;shape android:shape="rectangle"&gt;
  
              &lt;gradient
                  android:angle="0"
                  android:endColor="@color/color_white"
                  android:startColor="@color/color_white"
                  android:type="linear" /&gt;
  
              &lt;corners android:radius="6dp" /&gt;
  
          &lt;/shape&gt;
  
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>What i got in result :</p>
  
  <p><a href="https://i.stack.imgur.com/ah9HX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ah9HX.png" alt="enter image description here"></a></p>
  
  <p>Can anyone suggest me how can i give shadow to outline as in the mentioned above picture? OR any other solution like 9 patch image. How can i draw such 9 patch image ?</p>