Android: Databinding expression with enum comparison

Viewed 13193

is it possible to create a databinding expression and control the visibility of a view element by using enumerations? What I want to achieve is the following

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:visibility="@{user.editType == EditType.EDIT_PROFIL ? View.VISIBLE : View.GONE}">

The EditType class is very simple

public enum EditType {
  NONE,
  EDIT_PROFIL,
  EDIT_ADDRESSES; }

It would be awesome if I can use this enumeration within the XML to control the visibility of my LinearLayout.

Anybody got an idea how to achieve this?

2 Answers
Related