title: Android Databinding: how to get field value of kotlin enum class?
body: <p>I have an enum class with two fields:</p>
  
  <pre><code>enum class MyEnum(val text1: String, val text2: String) {
      A("a1", "a2"),
      B("b1", "b2")
  }
  </code></pre>
  
  <p>And I want to use that field values in XML with databinding. My ViewModel provides an <code>ObservableField&lt;MyEnum&gt;</code> which schould be used in XML via databinding:</p>
  
  <pre><code>class MyViewModel() : ViewModel() {
      val myEnum = ObservableField&lt;MyEnum&gt;(MyEnum.A)
  }
  </code></pre>
  
  <p>I try to read the field value in XML</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"&gt;
  
      &lt;data&gt;
  
          &lt;import type="com.example.MyEnum" /&gt;
  
          &lt;variable
              name="vm"
              type="com.example.MyViewModel" /&gt;
      &lt;/data&gt;
  
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;TextView
              android:text="@{vm.myEnum.text1}"
              android:layout_width="match_parent"
              android:layout_height="match_parent"/&gt;
  
      &lt;/FrameLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>but I get the following exception:
  Cannot find the setter for attribute 'text' with parameter string</p>