title: Not able to bind background attribute to a color
body: <p>I am trying to change the background attribute of a TextView based on a method which returns boolean value.
  So here's what my TextView looks like</p>
  
  <pre><code>&lt;data&gt;
      &lt;variable
          name="model"
          type="fit.cure.meetingdisplay.MeetingModel" /&gt;
  &lt;/data&gt;
  .....
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:background="@{model.isAvailable() ? @color/colorAvailable : @color/colorUnavailable, default=@color/colorAvailable"
      android:gravity="center"
      android:text="@{model.getAvailabilityText(), default=Available}"
      android:textAllCaps="true"
      android:textAppearance="@android:style/TextAppearance.Holo.Large.Inverse" /&gt;
  </code></pre>
  
  <p>The model is as follows - </p>
  
  <pre><code>public class MeetingModel {
      private boolean isAvailable = false;
  
      public boolean isAvailable() {
          return isAvailable;
      }
  
      public void setAvailable(boolean available) {
          isAvailable = available;
      }
  
      public String getAvailabilityText() {
          if (isAvailable) {
              return "available";
          }
          return "unavailable";
      }
  }
  </code></pre>
  
  <p>But I am getting this error while building the project - </p>
  
  <pre><code>error: '@{model.isAvailable() ? @color/colorAvailable : @color/colorUnavailable, default=@color/colorAvailable' is incompatible with attribute android:background (attr) reference|color.
  Message{kind=ERROR, text=error: '@{model.isAvailable() ? @color/colorAvailable : @color/colorUnavailable, default=@color/colorAvailable' is incompatible with attribute android:background (attr) reference|color., sources=[/Volumes/Projects/Work/Clients/CureFit/MeetingDisplay/app/src/main/res/layout/activity_main.xml:55], original message=, tool name=Optional.of(AAPT)}
  </code></pre>
  
  <p>I am using <code>@color/colorAvailable</code> since it was mentioned <a href="https://stackoverflow.com/questions/32992211/use-databinding-library-to-set-background-color-resource-or-null">here</a> that it's possible to use it. I also tried the drawable approach using the following for the background value - </p>
  
  <pre><code>"@{model.isAvailable() ? @drawable/drawable_available : @drawable/drawable_unavailable, default=@drawable/drawable_available"
  </code></pre>
  
  <p>The drawables are defined in colors.xml as following - </p>
  
  <pre><code>&lt;drawable name="drawable_available"&gt;@color/colorAvailable&lt;/drawable&gt;
  &lt;drawable name="drawable_unavailable"&gt;@color/colorUnavailable&lt;/drawable&gt;
  </code></pre>
  
  <p>Still getting the same error. Strangely the default value works in both the cases.</p>
  
  <p>So, is it something am I doing wrong here, or is it not possible to bind the background attribute at all (I don't think it's impossible though).</p>