title: How to set visibility for include layout in databinding?
body: <p>I have implemented data binding in my project. I have a particular screen with two nested layouts in include tags. I couldn't change the visibility for include layouts using data binding programmatically.</p>
  
  <p>However, I have achieved it through a boolean, but my question is how to set visibility for that include tag programmatically.</p>
  
  <p>My xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;include
    android:id="@+id/reg_email"
    layout="@layout/custom_email"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/&gt;
  
  
  &lt;include
    android:id="@+id/reg_phone"
    layout="@layout/custom_phone"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/&gt;
  </code></pre>
  
  <p>And in Activity:
  when I try to set this - it becomes red meaning it doesn't take it as a view.</p>
  
  <pre class="lang-java prettyprint-override"><code>  dataBinding.regPhone.setVisibility(View.GONE);
    dataBinding.regEmail.setVisibility(View.VISIBLE);
  </code></pre>