Reformat Whole Project Files in Android Studio

AndroidAndroid StudioFormattingAndroid Studio-2.2

Android Problem Overview


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?

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

This is how it works in Android Studio 3.5

Right click in your project or lib -> Reformat Code

See the image below:

Select what you want (clean up code will reformat your code) enter image description here

Wait until the progress finish.

that's it!

Good coding!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEren UtkuView Question on Stackoverflow
Solution 1 - AndroidmeistermeierView Answer on Stackoverflow
Solution 2 - AndroidFaustino GagnetenView Answer on Stackoverflow