If you go to: Android Studio -> Preferences -> Editor -> Code Style -> Java/Groovy/XML you find Default Scheme.
Or on MacOS: /Users/raiym/Library/Preferences/AndroidStudio3.1/codestyles/Default.xml
Where it comes from? Couldn't find which style guide Android Studio follows.
I've done quite a lot of researches, but in the end, I haven't reached a very satisfying answer: probably it's just a code style for IntelliJ.
The first thing I did was trying to compare the IntelliJ style with something else, but I always found some differences.
It doesn't follow Google's style because they don't fully qualify import, in fact, IntelliJ will try to unify imports by putting *
, like writing import foo.*;
instead of import foo.Bar;
.
It doesn't follow Oracle's guidelines either since the switch
statement is formatted in a different way:
switch (condition) {
case IDEA:
statements;
break;
case ORACLE:
statements;
break;
}
At this point, I've started looking for something else, but found even less. In fact, IntelliJ doesn't tell about the code style used in their software anywhere. Instead, they just explain how to change it.
Moreover, there are plugins for every possible code style! If one of them was the actual style in IDEA a plugin shouldn't be needed...
To make things worse, even for Kotlin, a language created by IntelliJ, they differentiate between "Kotlin Coding Conventions" and "IntelliJ IDEA default code style".
What I think is that they made a code style that works for most languages supported by their IDEs with little differences, and this is what Android Studio ended up using by default.
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