title: Viewbinding with error: incompatible with attribute android:visibility
body: <p>I'm trying to set the <code>visibility</code> and the <code>src</code> of an <code>ImageView</code> using data binding.  I don't know why this error is showing up, and I truely believe that this was working at one point, but I could be wrong.</p>
  
  <p>Layout:</p>
  
  <pre><code>&lt;data&gt;
      &lt;import type="android.view.View" /&gt;
      &lt;import type="android.support.v4.content.ContextCompat" /&gt;
      &lt;variable
          name="viewData"
          type="com.myapp.SomethingViewData" /&gt;
  &lt;/data&gt;
      ...
          &lt;ImageView
              ...
              android:src="@{ContextCompat.getDrawable(context, viewData.getIconResource())}"
              android:visibility="@{viewData.getIconVisibility() ? View.VISIBLE : View.GONE}" /&gt;
  </code></pre>
  
  <p>Data class</p>
  
  <pre><code>@Parcelize
  data class SomethingViewData(val iconResource: Int,
                               val iconVisibility: Boolean) : Parcelable
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>error: '@{ContextCompat.getDrawable(context, viewData.getIconResource())}' is incompatible with attribute android:src (attr) reference|color.   
  error: '@{viewData.getIconVisibility() ? View.VISIBLE : View.GONE}' is incompatible with attribute android:visibility (attr) enum [gone=2, invisible=1, visible=0]. 
  </code></pre>
  
  <p>What does this mean and how do I fix it?</p>