We're using the Eclipse code formatter. Unfortunately the order of our Java imports changes depending on whether you run Optimize Imports...
or Reformat Code...
last. One of them is alphabetical, and one of them is different (seems to do Android first, then our packages, then other Java packages).
There are a couple of ways to workaround this by having developers set up their Android Studio preferences in the same way, e.g.
Set up a rule to reformat on save, e.g. Intellij reformat on file save
Turn on
Optimize imports on the fly
:
Is there a way to do this as part of code formatting templates, instead of with per-developer preferences?