The official documentation on custom conversions in Android Data Binding is pretty scant. It says to create a static converter with the method signature to match the conversion, and annotate it with @BindingConversion, but it doesn't say where it will look for those methods. Does it just scan every static method in the whole app for BindingConversion annotations? Should I create a specific class for these conversions? Should it be in a specific package? Obviously it should be public. Please elaborate.
Yes, it can be any class in any package. It uses the java annotation processor, so it only picks up the annotated methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With