title: Static data-binding in Android [literals]
body: <p>I have created <strong>custom layout</strong> which contains image and title. To reuse this layout I'm using <code>&lt;include&gt;</code> tag. The problem is that I'm not even able to <strong>bind string literal</strong> into the layout being included. I tried to follow these  <a href="https://stackoverflow.com/questions/11265258/include-layout-with-custom-attributes#answer-38681418">instructions</a>, but without success. </p>
  
  <p><em>layout/titlebar.xml</em> </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;data&gt;
          &lt;variable name="title" type="String"/&gt;
          &lt;!-- &lt;variable name="imgSrc" type="android.graphics.drawable.Drawable" /&gt; --&gt;
      &lt;/data&gt;
      &lt;LinearLayout ... &gt;
          &lt;!-- &lt;ImageView ... android:src="{imgSrc}" /&gt; --&gt;
          &lt;TextView ... android:text="@{title, default=DefaultTitle}" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><em>layout/otherlayout.xml</em></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:bind="http://schemas.android.com/apk/res-auto"
                ... 
                &gt;
      &lt;!-- bind:imgSrc="@{@drawable/some_image}" --&gt;
      &lt;include layout="@layout/titlebar"
               bind:title="@{Example}"  &lt;---------- does not work 
               /&gt;
      ...
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In gradle I have enabled data-binding for module:</p>
  
  <pre><code>android {
      ...
      dataBinding {
          enabled = true
      }
      ...
  }
  </code></pre>