@BindingAdapter("errorText") fun TextInputLayout.s...
# android
a
@BindingAdapter("errorText") fun TextInputLayout.setErrorText(errorText: String?) { error = errorText }
g
Why so you need this binding adapter? You can just set error directly: app:error="${model.yourErrorString}"
a
com.google.android.material.textfield.TextInputLayout does not have an app:error argument to be used into the xml file
r
@alle.iacob just don't use Android Binding.
g
Raditya, it's just not helpful comment, it's not a discussion about should or not you use bindings
@alle.iacob it's not required to have app:error attribute, data binding allow you to call any method of this view, so if you have method error or setError, this will just work. So for such simple cases as just passing value to existing setter is just works without explicit adapters
a
ok, will try
thanks