title: Is it possible to conditionally show an XML include based on a classes method response?
body: <p>I'm wondering if it's possible to use DataBinding to do conditionally show a layout based on a methods boolean response. Here's what I'm trying to do</p>
  
  <p>XML Layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"&gt;
      &lt;data&gt;
          &lt;variable
              name="View"
              type="android.view.View"/&gt;
  
          &lt;variable
              name="App"
              type="com.app.JTApp"/&gt;
      &lt;/data&gt;
  
      &lt;include layout="@layout/view_checkout_total_cardview"
               android:visibility="@{App.isLandscape() ? View.GONE : View.VISIBLE}" /&gt;
  
  &lt;/layout&gt;
  </code></pre>
  
  <p>JTApp class:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class JTApp {
  
      public boolean isLandscape() {
          Timber.d("putty-- isLandscape: --------------------------");
          return getResources().getBoolean(R.bool.is_landscape);
      }
  
      …
  }
  </code></pre>
  
  <p>Currently this doesn't work. Am I missing something or is this not possible? I'm coming from the web where this is possible with frameworks like Angular.</p>