I am using Android LintFix (see slide 119 or code examples) and I have managed to do fixes for the function, however it does not seem to be possible to add imports like Kotlin @Deprecated annotation. Is it possible to do somehow or should I rely on the IDE for auto-import?
Thanks to Mark Prengemann who indicated me the solution:
Using fully qualified names with reformat(true)
and shortenNames()
:
LintFix.create().replace()
.text("<original>").with("<correction with fully qualified entities>")
.shortenNames()
.reformat(true)
.build()
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