I am working on DataBinding
with BindingAdapter
. Here is my custom method.
@BindingAdapter(\"{bind:fadevisible}\")
public static vo
In my particular case, my BindingAdapter
had two parameters, with requireAll
, and I had neglected to put one of them on the element in my layout XML. So, like this: (Kotlin, I know)
@BindingAdapter("app:arg1", "app:arg2", requireAll = true)
fun MyAdapter(view: ImageView, x: String, y: Int) {
// ...
}
<Element app:arg1="@{"foo"}"/>
The error was roughly Cannot find the setter for attribute "app:arg1" with parameter String
which is perfectly true, there is no such adapter; there's only one for two args.
One hint that this was happening was that Android Studio indicated that MyAdapter
was an unused function by coloring it grey.
Obviously a more eloquent error message like "there is no adapter for app:arg1
of type String
but there is one for..." (when one of the attribute names matches) would be appreciated, but I won't hold my breath.