How are @ values ​​evaluated from XML files in Android Studio

In android studio, if I write:

android:background="@color/dark_grey"

The value is dark_greyviewed in res/values/colors.xml.

If I have:

<include layout="@layout/content_reminders" />

The value is displayed as res/layout/content_reminders.xml.

Questions:

  • How is the search?

  • How to configure additional search directories? For example, what if I wanted to have @layout2/something_elsethere? Or is it not allowed? And anyway, where from @layout? Is this in the project configuration?

[ADDED QUESTION]

  • How does Gradle deal with ambiguity?

: @color/dark_grey, - @layout/content_reminders. , res/layout res/values , Gradle , @layout/content_reminder content_reminder res/values/layout.xml ( layout.xml res/layout)?

+4
4

Android Studio resources. , res/values/xxxxx.xml, , <color> <string>, XML .

, , . , @color/dark_grey, , drak_grey . lookup Studio.

- @layout2 <include>, . View ViewGroup. Android Studio , .

, Project. resources () . , , . , , , gradle.

layout, color, string . @layout/ . Android Studio. IDE. , .

gradle ? , , gradle. Build Tools, SDK, .

+2

SDK Integer res/values ​​. , . , R.java .

-1

no no no, you cannot use @ layout2 / something_else. the compiler just looked at @layout.

-1
source
<include layout="@layout/a" />

try pressing Alt + Insert when the mouse is on @layout/a;

-2
source

Source: https://habr.com/ru/post/1613282/


All Articles