Reputation: 765
I'm using Android Studio on OS X, and want to import intellij-java-google-style.xml
for my code format.
But I can't find import
at Preferences -> Project Settings -> Code Style -> Manage
only Save as
, Delete
, Copy to project
, and Close
there.
Upvotes: 46
Views: 37691
Reputation: 1770
In the latest Android Studio (as of this edit, 4.1.1) you can go to Preferences -> Editor -> Code Style -> Scheme -> Settings Icon (Gear) -> Import Scheme...
and import the xml there.
Upvotes: 14
Reputation: 8245
If you are on Android Studio Preview you will need to copy your style xml file to:
~/Library/Preferences/AndroidStudioPreviewX.X/codestyles
where X.X is your Preview version ie. 1.4
Upvotes: 8
Reputation: 103
Also, for those who use Android Studio on windows. Copy your xml file to $USER_SPACE$\.AndroidStudio1.X\config\codeStyles
. If you don't have the codeStyles folder, just create one. And then you will see it in Settings->Editor->Code Style->Scheme
.
Upvotes: 7
Reputation: 161
I am using Android Studio 1.2 on Ubuntu 12.04 and in my case I have an .AndroidStudio1.2 folder in my home directory. In this folder there is a config folder. What I did was the following:
NOTE: Android Studio does not give you an option to import the xml file. And before you add the file to the codestyles folder there is NO indication that you can change the Schema to your own in any way. But after you have added the file the added schema will be shown among the other schemas.
NOTE 2: In other Operating systems this folder is located elsewhere. For more info on configuration folders see here: http://tools.android.com/tech-docs/configuration
Upvotes: 13
Reputation: 319
Copy intellij-java-google-style.xml
into the directory $HOME/Library/Preferences/IdeaIC14/codestyles/
.
Upvotes: 31
Reputation: 1151
Here are steps I used to import my coding style for a project.
codingStyle.xml
to .idea folder under your project.Project
for coding style scheme, click OK.codingStyle.xml
to .idea folder again (Android Studio most likely had overwritten with default settings your codingStyle.xml
when you click OK on step 2)Upvotes: 5