title: Syntax for conditional statements in Android XML Layout
body: <p>With databinding we now often see codes in layout files like this:</p>
  
  <pre><code>&lt;Variable name="displayIt" type="Boolean"/&gt;
  </code></pre>
  
  <p>and then later:</p>
  
  <pre><code>android:visibility="@{displayIt ? View.VISIBLE : View.GONE}"
  </code></pre>
  
  <p>(of course android.view.View must first be imported for View.VISIBLE and View.GONE to have any meaning)</p>
  
  <p>This makes controlling the view much easier.
  It also tells me that conditional statements are allowed in XML Layout, but it looks like my google-fu is weak, I tried and couldn't find the syntax for this.
  What if I want to use literals? Something like:</p>
  
  <pre><code>android:text="{@isValid ? "valid" : "invalid"}"
  </code></pre>
  
  <p>(yes I know that's a stupid way of doing it, I am just talking about the syntax here).
  Or what about resource ID's? Maybe like:</p>
  
  <pre><code>android:color="@{isValid ? R.color.green : R.color.red}"
  </code></pre>
  
  <p>Can it be done? What's the proper syntax?</p>