Reformat Whole Project Files in Android Studio

10,847

Solution 1

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

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!

Share:
10,847
Eren Utku
Author by

Eren Utku

Currently, Android Developer at ANWB and former Android Developer at IBM and ING Bank. Got his bachelor’s in Computer Engineering at Selcuk University'11-15. Blog & Apps

Updated on July 01, 2022

Comments

  • Eren Utku
    Eren Utku almost 2 years

    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?