4

I'm trying to use data binding for dynamic layout binding. For example:

<include
        layout="@{item.getLayoutRes}"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

Assuming that item object defines getLayoutRes method, marked with @LayoutRes, that provides an int describing a layout to inflate.

Looks like this is not supported yet, or the syntax is different?

tomrozb
  • 25,773
  • 31
  • 101
  • 122
  • I don't think that would be supported. As ids will be dynamic and layout files are generated at compile time.. – kirtan403 Sep 06 '16 at 18:44

0 Answers0