title: Selector, Layer-list and shape/bitmap in the same xml
body: <p>I have this code in an xml inside the <code>drawable</code> folder:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item android:state_pressed="true"&gt;
          &lt;layer-list&gt;
              &lt;item&gt;
                  &lt;shape android:shape="rectangle"&gt;
                      &lt;size android:width="90dp" android:height="90dp" /&gt;
  
                  &lt;solid android:color="#9933CC" /&gt;
                  &lt;/shape&gt;
              &lt;/item&gt;
              &lt;item&gt;
                  &lt;bitmap android:gravity="center" android:src="@drawable/main_achievements_synthesis" /&gt;
              &lt;/item&gt;
          &lt;/layer-list&gt;
      &lt;/item&gt;
      &lt;item&gt;
          &lt;layer-list&gt;
              &lt;item&gt;
                  &lt;shape android:shape="rectangle"&gt;
                      &lt;size android:width="90dp" android:height="90dp" /&gt;
  
                      &lt;solid android:color="#AA66CC" /&gt;
                  &lt;/shape&gt;
              &lt;/item&gt;
              &lt;item&gt;
                  &lt;bitmap android:gravity="center" android:src="@drawable/main_achievements_synthesis" /&gt;
              &lt;/item&gt;
          &lt;/layer-list&gt;
      &lt;/item&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>I use it to have an image with 2 states (to use as a button). Everything works as expected on emulator and devices.</p>
  
  <p>I know that I can create different drawable xml and make a reference to achieve the same result.</p>
  
  <p>I just switched to Android Studio and it shows me this mesage: <code>Element XXX is not allowed here</code>. It warns me about Layer-list and all the tags inside it. However, as I said, this code works just fine.</p>
  
  <p>Should I switch my code into separated XMLs (knowing that I will only use them once) or is an "error" in the Android Studio's Inspector Code?</p>
  
  <p>NOTE: I think my code can be optimized, but I haven't figured out how yet.</p>