Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reformat Whole Project Files in Android Studio

I need to update my code style. Reformatting the whole project files one by one takes too much effort with the shortcuts I know.

Opt + Command + L

My Question?

Is there any other way to do it for the whole project?

like image 764
Eren Utku Avatar asked Dec 02 '16 07:12

Eren Utku


People also ask

How to Reformat in Android Studio?

After opening the file we have to simply press the shortcut key as Ctrl+Alt+L to reformat the code in your file. With this key, the code in your file will be rearranged according to the code standards.

What is code cleanup in Android Studio?

Code cleanup refers to the act of writing code so that it cleans up leftover data structures and other unwanted materials from memory and the filesystem. It is sometimes treated as a synonym of refactoring code, which involves making the source code itself easier to understand, maintain, and modify.

What is reformat code in IntelliJ?

You can reformat line indents based on the specified settings. While in the editor, select the necessary code fragment and press Ctrl+Alt+I . If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style.


1 Answers

Use the re-format code shortcut (default: ⌘ + Opt + L (Mac) / Ctrl + Alt + L (PC)) in the Project Files View/Explorer on the desired root folder(s) and then check Include subdirectories.

Project File View

Reformat Code Options

like image 195
meistermeier Avatar answered Sep 21 '22 12:09

meistermeier