Android Studio 3.3 folder icons

我的未来我决定 提交于 2021-02-06 08:47:21

问题


On the new Android Studio 3.3 some icons have change and I'm looking to understand what each one of the mean.

This and this answers are outdated.

For example in this picture I have two modules inside my project, but one have a green dot and the other this bar chart. What it means?


回答1:


There's two components to the tree: The background color/folder color, and additional icons. Beyond this, there's also the text color, but it's mainly used for VCS and is beyond the scope of the question. See this answer for VCS color meanings.

Because you're asking about folders in general in one part, icons in another, then two specifically in the last, I'm going to cover the various folder-based ones.

To start off, the exact colors depends on the color scheme, and in some cases plugins (there are a few plugins, for an instance the Material plugin, that entirely re-do the folders) that change these, but I'll be using a non-standard theme with the standard icons (TL;DR: different colors, same icons).

Important factors

Before I get started on the list itself, there are a few different factors that determine the icon:

  • Folder status (included/ignored)
  • Folder type
    • Module type (i.e. android, java library, etc)
    • General type (i.e. assets, resources, package, etc)
  • Source set (sources and tests) or hierarchical parent (I.e. test resources have a different icon from non-test resources)

In addition, there's file type, but those are out of the scope. Additionally, for the folder icons to be visible, the project needs to be successfully compiled. Failed compiling may result in AS/IntelliJ interpreting the folders differently, or even unregister source sets.

Additionally, it's worth noting that failed builds or re-building can, in some cases, change the folder icon to an incorrect (although related) one. In a recent module build on the test project, that the library module was unregistered, and the Android module was marked a Java module. This doesn't break anything though, but it's a good idea remembering this isn't always accurate.

The list

First off, we have the green dot:

This means it's an Android module.


There's also one with a coffee cup:

This can denote either a Java module, or the root for an Android project (because in that regard, the Android projects are considered Java projects too).


There's also some folders with the color blue. These note source roots. In the project view, you typically find java, alternatively with other languages if you separate it like that:

In the Android view, the manifest folder is considered a source root.


Test roots have green folders (+ a green background):


The bar chart folder is an Android library module (note that this isn't the same as a regular Android module):

The main difference between this and a regular Android module is that it applies the Gradle plugin com.android.library, compared to the regular com.android.application you find in the regular Android modules.


We also have plain folders:

And these are just folders. They may contain assets or resources, but aren't considered anything special. They're also not linked to anything in the IDE, but they may still have relevance depending on your build system. It doesn't always pick up on stuff like that.


Generated sources have a separate icon too, with a gear-like icon in the bottom right corner:


This one should be familiar:

This is the icon for a package. Note that it's not only used in source sets, it's also used under resources and assets.


Speaking of resources and assets, that brings us to the next icon:

This is used for any resource root, although Android treats these differently during compilation and loading.


And while on that topic, test resources have their own icon as well:

This is in addition to having a green background


Orange folders (using a near standard theme, and again, the colors vary. Refer your color scheme for more info if you're using a non-standard theme) show excluded folders.

This is as per project structure, an you can chose folders to exclude. .gradle is excluded by default, as can be seen here:

But you can also chose other folders to exclude. This excludes it from indexing


And (in theory) last: The fake folder.

This isn't actually a folder - this is a file containing various config for the module, generated by IntelliJ. Yet, for some reason, it has a folder icon (at least for me). While this isn't a folder, I've added this to avoid confusion. While it looks like an Android module, it isn't.


These are all the unique folder icons I can find. I hope I haven't left any out.

Special note

If you use a plugin such as Material Theme UI, you might have different icons. Some plugins like that bundle custom icons, which makes this answer incorrect for those specifically. With the example one, all the icons (link: folder icons) are available with names.

Additionally, some of the stock IntelliJ icons can be found here with names, if you're ever in doubt. The modules folder appears to contain some of the folder icons as well. I haven't been able to pinpoint the sources for the Android-specific icons though, but that covers some of them.



来源:https://stackoverflow.com/questions/55575449/android-studio-3-3-folder-icons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!