title: Android Custom shape for EditText
body: <p>I am trying to create a custom design for EditText. See the attached image below,</p>
  
  <p><a href="https://i.stack.imgur.com/0prjk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0prjk.png" alt="enter image description here"></a></p>
  
  <p>I am trying to achieve this using a custom shape like the one defined below.</p>
  
  <pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item android:drawable="@drawable/places_ic_search"
          android:width="30dp"&gt;
          &lt;shape
              android:shape="rectangle"&gt;&lt;/shape&gt;
      &lt;/item&gt;
  
      &lt;item
          android:left="30dp"
          android:drawable="@color/white"&gt;
          &lt;shape android:shape="rectangle" &gt;
              &lt;gradient android:startColor="#000000" android:endColor="#FFFFFF" android:angle="90"/&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>But the search icon is not displayed. How can I achieve this?</p>
  
  <p>Thanks.</p>
  
  <p>I have applied the answer by tiny sunlight and the EditBox looks like this, Search icon is no aligned to the left.</p>
  
  <p><a href="https://i.stack.imgur.com/adHpb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/adHpb.png" alt="enter image description here"></a></p>