cachapa / ExpandableLayout

An expandable layout container for Android
Apache License 2.0
2.34k stars 273 forks source link

Data Binding build error #73

Closed Narinc closed 4 years ago

Narinc commented 5 years ago

app:el_expanded="@{model.selectedPayOption.get() == PayOption.WITHOUT_CARD ? true : false}"

Found data binding errors. / data binding error msg:Cannot find the setter for attribute 'app:el_expanded' with parameter type boolean on net.cachapa.expandablelayout.ExpandableLayout. file:/home/volkan/AndroidStudioProjects/temp/android/app/src/main/res/layout/fragment_reservation_second_step.xml loc:292:35 - 292:104 \ data binding error

paulkugaev commented 4 years ago

@Narinc you should use actual setter that is in code, not the xml attr in this case try app:expanded

cachapa commented 4 years ago

Thanks @paulkugaev I forgot that the Android tools still don't support custom XML attributes for databinding.

paulkugaev commented 4 years ago

@cachapa why "still"? Databinding is about code, custom view attrs is not code. Thats why in databinding we use the actual method name without "set" (if method is setExpanded then in databinding it'll be just app:expanded). Custom view attrs won't work at all coz they are used only in view constructor. Databinding is about bringing code into xml