How to use method of object in Android data binding?
<p>Suppose I have this object:</p>

<pre><code>public class Field
{
   List&lt;String&gt; list;
   public Field()
   {
     list = new ArrayList();
   }
   public boolean isOnTheList(String someText)
   {
     return list.contains(someText);
   }
}
</code></pre>

<p>Now I want to use this function on a xml with binding like this.</p>

<pre><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"&gt;

&lt;data&gt;

    &lt;import type="android.view.View"/&gt;

    &lt;variable
        name="field"
        type="com.greendao.db.Field"/&gt;        

    &lt;variable
        name="user"
        type="com.package.User"/&gt;
&lt;/data&gt;

&lt;LinearLayout
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"    
    android:visibility="@{field.isOnTheList(user.name)?View.VISIBLE:View.GONE}"
    tools:context=".advisor.new_visit_report.activities.FieldsSelectionActivity"&gt; ...
</code></pre>

<p>The problem is that is not working. Anyone has already tried this?            </p>