Android Data Binding: visibility on include tag
<p>As per <a href="http://developer.android.com/tools/data-binding/guide.html#imports">http://developer.android.com/tools/data-binding/guide.html#imports</a>, we can have such simple expressions in visibility:</p>

<pre><code>&lt;TextView
..
android:visibility="@{user.isAdult ? View.VISIBLE : View.GONE}"/&gt;
</code></pre>

<p>But when I try to do the same in an <code>include</code> tag, like so:</p>

<pre><code>&lt;include
android:id="@+id/image_layout"
layout="@layout/image_layout"
android:visibility="@{notification.notifType == 0 ? View.VISIBLE : View.GONE}"/&gt;
</code></pre>

<p>Then Studio not only shows the expression in red, but upon building it gives the following error in the auto-generated binding class:</p>

<blockquote>
  <p>Error:(138, 29) error: cannot find symbol method setVisibility(int)</p>
</blockquote>

<p>Here's where the error occurs in the auto-generated binding class</p>

<pre><code>// batch finished
if ((dirtyFlags &amp; 0x3L) != 0) {
    // api target 1
    this.imageLayout.setVisibility(NotifTypeNotificatio1);
}
imageLayout.executePendingBindings();
</code></pre>