とりあえず結果
1.ターミナルで下記コマンド実行
curl -L https://gist.githubusercontent.com/futabooo/20513ee54c8afd05b4b8/raw/67670d97f060b5dbe8d590e8c9700855d8decd99/AndroidStyleCodeStyleInstall.sh | sh
2.AndroidStudio > Preferences > Code Style > Scheme でAndroidStyleを選択してOK
詳細
OSクリーンインストールしたり、AndroidStudio再インストールしたりなんかでちょいちょい設定しなおしてるので、スクリプトを用意してみました。
#!/bin/bash
# Installs AndroidStyle IntelliJ configs into your user configs.
# Reference https://github.com/square/java-code-styles/blob/master/install.sh
echo "Installing AndroidStyle IntelliJ configs..."
for dirs in $HOME/Library/Preferences/IntelliJIdea* \
$HOME/Library/Preferences/IdeaIC* \
$HOME/Library/Preferences/AndroidStudio* \
$HOME/.IntelliJIdea*/config \
$HOME/.IdeaIC*/config \
$HOME/.AndroidStudio*/config
do
if [ -d $dirs ]; then
# Install codestyles
mkdir -p $dirs/codestyles
curl -L https://raw.githubusercontent.com/android/platform_development/master/ide/intellij/codestyles/AndroidStyle.xml \
> $dirs/codestyles/AndroidStyle.xml
fi
done
echo "Done."
echo ""
echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'AndroidStyle' or '."