To configure IntelliJ/Android Studio according to this style guide, you can either import the settings file in Android Studio settings folder or follow the steps:
- Go to
Settings|Editor|Code Style|Kotlin - Click
Set from…link in the upper right corner - Select
Predefined style|Kotlin style guidefrom the menu. [link]
- Still in
Settings|Editor|Code Style|Kotlin - Click
Wrapping and Bracestab - Set
Hard wrap atfield to120[link]
- Still in
Settings|Editor|Code Style|Kotlin - Click
Blank Linestab - In setction
Keep Maximum Blank lines -
- Set
In declarations:to1
- Set
-
- Set
In code:to1
- Set
-
- Set
Before '}':to1
- Set
- In setction
Minimun Blank lines -
- Set
After class header:to0
- Set
-
- Set
Arround 'when' branches with {}to0
- Set
-
- Set
Before declaration with comment or annotationto1[link]
- Set
- Still in
Settings|Editor|Code Style|Kotlin - Click
Importstab - In setction
Top-level name import -
- Select entry
Use single line imports
- Select entry
- In section
Java Statics and Enum Members -
- Select entry
Use single line imports
- Select entry
- In section
Packages to Use Import with '*' -
- Remove packages clicking the
-button [link]
- Remove packages clicking the
- Still in
Settings|Editor|Code Style|Kotlin - Click
Othertab - Select entry `Use trailing commas`` [link]
- Go to
Settings|Editor|General - Scroll to the
Save Filessection - Check
Ensure an empty line at the end of a file on Save[link]