diff --git a/configs/codestyles/SquareAndroid.xml b/configs/codestyles/SquareAndroid.xml index 9601db8..7b8b7b9 100644 --- a/configs/codestyles/SquareAndroid.xml +++ b/configs/codestyles/SquareAndroid.xml @@ -3,9 +3,9 @@ - - - + + + @@ -185,16 +185,15 @@ - - + - - - + + + @@ -222,8 +221,8 @@ - - + + @@ -231,9 +230,9 @@ - - - + + + @@ -265,9 +264,9 @@ - + - + @@ -380,4 +379,4 @@ - \ No newline at end of file + diff --git a/install_os.sh b/install_os.sh new file mode 100644 index 0000000..034583d --- /dev/null +++ b/install_os.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Installs OSAndroid Code style into your AndroidStudio/IntelliJ + +echo "Installing Oversea Android Code Style ..." + +# Config file path +URL="https://raw.githubusercontent.com/kyangc/java-code-styles/master/osandroid.xml" + +#Config file name +FILE="OsAndroid.xml" + +# Download config +curl --silent -o $FILE $URL + +for i 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 $i ]]; then + + # Copy file into codestyles + mkdir -p $i/codestyles + cp -frv ./$FILE $i/codestyles + + fi +done + +# Remove source file +rm ./$FILE + +echo "Done." +echo "" +echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'OsAndroid'." diff --git a/osandroid.xml b/osandroid.xml new file mode 100644 index 0000000..c6daf52 --- /dev/null +++ b/osandroid.xml @@ -0,0 +1,583 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + xmlns:android + + ^$ + + + + + + + + + xmlns:.* + + ^$ + + + BY_NAME + + + + + + + .*:id + + http://schemas.android.com/apk/res/android + + + + + + + + + style + + ^$ + + + + + + + + + .* + + ^$ + + + BY_NAME + + + + + + + .*:.*Style + + http://schemas.android.com/apk/res/android + + + BY_NAME + + + + + + + .*:layout_width + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_height + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_weight + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_margin + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginTop + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginBottom + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginStart + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginEnd + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginLeft + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_marginRight + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:layout_.* + + http://schemas.android.com/apk/res/android + + + BY_NAME + + + + + + + .*:padding + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingTop + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingBottom + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingStart + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingEnd + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingLeft + + http://schemas.android.com/apk/res/android + + + + + + + + + .*:paddingRight + + http://schemas.android.com/apk/res/android + + + + + + + + + .* + http://schemas.android.com/apk/res/android + + + BY_NAME + + + + + + + .* + http://schemas.android.com/apk/res-auto + + + BY_NAME + + + + + + + .* + http://schemas.android.com/tools + + + BY_NAME + + + + + + + .* + .* + + + BY_NAME + + + + + + + + + + + + + +