Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop android studio grouping single-item directories with a dot

If I have a directory which only (at present!) contains another directory Android Studio decides, for some strange reason, to not expand the directories in the usual manor - ie click folder1 to reveal folder2, then click folder2 to show its contents - but instead put them together in a single entry (folder1.folder2). This makes the directory structure incredibly difficult and inconsistent to deal with when trying to manipulate the contents. Right now I'm having to revert to doing so in windows explorer!

Is the any way to change this peculiar behavior.

enter image description here

like image 626
LairdPleng Avatar asked Nov 06 '15 06:11

LairdPleng


3 Answers

Click the settings icon in the Project view and uncheck Compact Empty Middle Packages.

enter image description here

Note: this screenshot is from IntelliJ Ultimate, but it should look the same (or similar) in Android Studio.

like image 186
Bohuslav Burghardt Avatar answered Nov 08 '22 04:11

Bohuslav Burghardt


I got it to work similarly by going to the Project View settings and then unchecking the Flatten Packages option. This then got my folder configuration to the desired subfolder configuration format as described above. This may be new compared to the answer of 5 years ago. In my case, only unchecking the Compact Empty Middle option was not enough.

like image 42
George Lee Avatar answered Nov 08 '22 05:11

George Lee


Use combination of Ctrl+Shift+A inside Android studio, it's a shortcut for "Find Action..." and type in "package", there is "Compact Middle Packages", turn that off.

like image 1
tuulingo Avatar answered Nov 08 '22 04:11

tuulingo