I'm trying to use native 2-way android data binding in my custom control
so I have something like that in xml
<layout>
<data>
<variable name="item" type="Boolean"/>
</data>
...
<my.control app:vm="@={item}"/>
...
</layout>
Please note, it's question about @={}
- native 2 way binding.
and something like that in code:
class MyControl extends RelativeLayout{
...
@BindingAdapter("app:vm")
public static void setVm(View v, VM vm){...}
}
My questions - how should I define getter for my viewModel? I don't find any guidance about it. I tryed different approaches - write custom getter, static getters but error still the same.