title: reusing a layout along with it's child components
body: <p><a href="https://developer.android.com/training/improving-layouts/reusing-layouts" rel="nofollow noreferrer">I have taken a look at android docs</a>, but it doesn't give you any hint on how to override child component's properties using xml(nor programmatically, - I'd prefer <code>xml</code> at this point though).  </p>
  
  <p>Consider the following layout called <code>layoutBase.xml</code>:  </p>
  
  <pre><code>&lt;LinearLayout 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"
      android:background="@color/titlebar_bg"
      tools:showIn="@layout/activity_main" &gt;
  
      &lt;ImageView 
                 android:id="@+id/myImageViewBase"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/gafricalogo" /&gt;
      &lt;TextView
                 android:id="@+id/myTextViewBase"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"/&gt;
  
  &lt;/LinearLayout&gt;  
  </code></pre>
  
  <p>Now, I have two other layouts called <code>layout1.xml</code> and <code>layout2.xml</code> where I'd like to <em>reuse</em> this layout using the <code>include</code> tag, but I'd like to do the following things, which <a href="https://developer.android.com/training/improving-layouts/reusing-layouts" rel="nofollow noreferrer">is not mentioned in the docs</a>:  </p>
  
  <ul>
  <li><p>The root <code>LinearLayout</code> can be given a different <code>id</code> but, how do I
  give a different <code>id</code> to both the <code>ImageView</code> and <code>TextView</code>after I
  include (using <code>&lt;include ..&gt;</code>) this layout in the <code>layout1.xml</code> and
  <code>layout2.xml</code></p></li>
  <li><p>If I want the <code>ImageView</code> to contain different images in the
  <code>layout1.xml</code> and <code>layout2.xml</code> how do I change this property using
  the <code>&lt;include ...&gt;</code> tag?</p></li>
  </ul>