title: How to make Android Studio's tools:listitem work on the merge tag?
body: <p>I'm designing a pretty complicated form on Android, and I'm using <code>include</code>s in my fragment. I basically have this:</p>
  
  <p><strong>include_form.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:orientation="vertical"
    tools:parentTag="android.widget.LinearLayout"&gt;
  
      ...
  
      &lt;Spinner
        android:id="@+id/desired_time_input"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:prompt="@string/time_desired_field"
        android:spinnerMode="dialog"
        tools:listitem="@layout/item_spinner_simple" /&gt;
  
      ...
  
  &lt;/merge&gt;
  </code></pre>
  
  <p>which renders beautifully on Android Studio's preview. However, when including this on another file, like this:</p>
  
  <p><strong>fragment_signup.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"&gt;
  
    ...
  
    &lt;include
      layout="@layout/include_form"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" /&gt;
  
    ...
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This renders well on a device, or a simulator, but it's not rendered correctly on Android Studio's preview: it basically ignores the <code>tools:listitem</code> attribute on the <code>Spinner</code>. </p>
  
  <p>This works flawlessly for other components, such as a RecyclerView. Does anyone have an idea, or have I stumbled upon a bug? Thanks!</p>
  
  <p>** Edit 1 **</p>
  
  <p>Tried to add <code>tools:listitem="@layout/item_spinner_simple"</code> to the <code>include</code> tag and that didn't work.</p>
  
  <p>** Edit 2 ** </p>
  
  <p>It really does seem that this is a bug. I've created a bug report:
  <a href="https://issuetracker.google.com/issues/132686264" rel="nofollow noreferrer">https://issuetracker.google.com/issues/132686264</a></p>