Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the Style of Braces in Android Studio

I recently started to use Android Studio. It uses this style of braces by default:

public void scanFile(String filePath) {

}

The code I need to submit requires to be styled as follows:

public void scanFile(String filePath) 
{

}

Where can I find a setting for this?

like image 831
user3081519 Avatar asked Apr 18 '14 02:04

user3081519


2 Answers

You need to change the code style in Project Settings

File -> Settings -> (Project Settings) -> Code Style -> Java -> Wrapping and Brances

Change the Braces Placement for Class and Method declaration to Next Line

(Or, on a Mac, do the same thing in Preferences)

enter image description here

like image 58
Libin Avatar answered Oct 19 '22 02:10

Libin


This one worked for me in Android Studio 3.0 Beta 7

change braces placement in Android Studio 3

like image 41
Yasser Jarouf Avatar answered Oct 19 '22 00:10

Yasser Jarouf