6

Not sure if this is possible, but I have many multi module projects. Each module essentially follows module/src/main/java/packages... This is shown in photo below

file structure

Currently I have to click src -> main -> java -> etc....

Ideally I would like to just click src and have the whole directory open up. This would save me a good amount of time in the long run. I have searched for an Android Studio setting that does this but no luck. Would I have to write some kind of script for this? I'm lost on how to achieve this

Thanks

Kyle
  • 695
  • 6
  • 24
  • Do you want to navigate to a specific file in the tree or you want to see the whole tree? – Harikumar Alangode Jan 10 '20 at 08:40
  • whole tree..I want to avoid the click chain of `src` -> `main` -> `java` -> `pkg1` -> `pkg2` -> `pkg3..` -> `etc` I've looked at the project structure settings and `flatten packages` helps but doesn't provide the behavior i'm looking for – Kyle Jan 10 '20 at 15:36

3 Answers3

1

I don't think exactly what you're looking for exists (to my knowledge, and I've been using Android Studio since its beta).

I think the closest thing you're looking for are these two things: 'Compact Middle Packages' and/or setting your project view to 'Android' (see screenshots below).

I hope this helps, if not, you could create a feature request to the Android Studio team.

1 2

Joshua King
  • 3,450
  • 1
  • 17
  • 19
1

You can use the key * on the numeric keypad, it will automatically expand the tree. This setting can be configured with a different key by searching:

Fully Expand Tree Node

Yoann Hercouet
  • 17,894
  • 5
  • 58
  • 85
  • This is as close as I could get, I'll need to play around and see if I can prevent it from opening up `test`, etc.. but this does open up the entire tree which I what I was looking for. Thanks – Kyle Feb 24 '20 at 14:04
0

Set your project view to 'Android' and select 'Flatten Packages' as shown in image.

enter image description here

When you expand java it will show list of all packages (check below image). enter image description here

Jaiprakash Soni
  • 4,100
  • 5
  • 36
  • 67