In Eclipse,(Window -> Preferences -> Java -> Code Style -> Formatter) there was a facility to create my own format style and apply it in the code. Is there a way to do that
Open global settings/preferences via ⌘, or Android Studio > Prefences.
In the left hand side bar, go to Editor > Code Style.
open the scheme:
drop down menu and select Default IDE
.
Click the cog menu to the right of the drop down menu and select duplicate...
.
Then rename your new profile, and change the general settings as well as the settings for each language in the sub menu of Code Style as you see fit.
Then with you new profile selected, reformat your code with ⌘ + ⌥ + L
These style are global and can be used in other projects.
Same method applies for Code Cleanup too.