I use databinding to set the tint of my ImageView
. And this is working well :
android:tint="@{plantEntity.isFavorite ? @color/favorite : @color/favorite_none}" />
The problem is android:tint
is deprecated. When I try to use app:tint
instead, I have this error :
Cannot find a setter for <android.widget.ImageView app:color> that accepts parameter type 'int' If a binding adapter provides the setter, check that the adapter is annotated correctly and that the parameter type matches.
Why and what I have to do ? Create a BindingAdapter
?
app:
prefix in the Binding Adapter annotation. – Yila