How to remove the 'expand all' button from Android Studio & IntelliJ IDEA

21 November 2023

·

2 min read

A person watching the ever expanding universe, just like the expand all button in Android Studio & IntelliJ IDEA.

Photo by Greg Rakozy on Unsplash.

How often have you accidentally clicked the ‘expand all’ button in the Android Studio / IntelliJ IDEA project window? Personally, I’ve done that more often than I’d like to admit. This then renders my IDE unusable for minutes at a time, as it is processing (and expanding) the entire folder tree of my project. This problem is only exacerbated the larger your project gets. Fortunately, there’s a solution!

The Android Studio & IntelliJ project window icons, with the 'expand all' button visible.

Solution

The solution involves removing the ‘expand all’ button altogether. For me this is an adequate solution, as I cannot think of any scenario in which I’d want to expand all directories. (Collapsing all is a different story.) We can do this as follows.

Android Studio and IntelliJ IDEA both have a “hidden settings” feature, called Registry. It works similar to the Windows registry, and to Chrome’s chrome://flags. We have to unset a specific flag here to remove the ‘expand all’ button. Here’s how to do it:

  1. In the menu bar (at the top of the window on Windows, at the top of the screen on macOS), click ‘Help’, then ‘Find Action’.
  2. Type “Registry” and click to open the Registry.
  3. Search for ide.project.view.expand.all.action.visible, and unset it.
  4. Close the registry, and that’s it! You should immediately see that the button is gone.
The Android Studio & IntelliJ project window icons, with the 'expand all' button removed.

Hope this helps! I know it has saved me countless frustrating moments already. If you have any questions or comments, you can post them on Mastodon, Bluesky or Twitter. (I’m also on Threads, but currently unable to use it due to being in the EU. Feel free to follow me though.)

One more thing…

Do you love newsletters? But hate a cluttered inbox? Then you might like Feedo, which I built to solve this! Feedo takes your newsletters out of your inbox, and presents them in a beautiful feed.

More reasons to love Feedo: Download Feedo now on Google Play! Google Play Store