You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Android: Add export option for custom theme attributes
- Regenerates the `GodotAppMainTheme` and `GodotAppSplashTheme` during Android export. Any manual changes to these styles will be cleared and replaced with default theme attributes.
- Adds a new export option `gradle_build/custom_theme_attributes` for injecting custom theme attributes directly via the export window, avoiding the need to manually modify themes.xml.
A dictionary of custom theme attributes to include in the exported Android project. Each entry defines a theme attribute name and its value, and will be added to the [b]GodotAppMainTheme[/b].
57
+
For example, the key [code]android:windowSwipeToDismiss[/code] with the value [code]false[/code] is resolved to [code]<item name="android:windowSwipeToDismiss">false</item>[/code].
58
+
[b]Note:[/b] To add a custom attribute to the [b]GodotAppSplashTheme[/b], prefix the attribute name with [code][splash][/code].
59
+
[b]Note:[/b] Reserved attributes configured via other export options or project settings cannot be overridden by [code]custom_theme_attributes[/code] and are skipped during export.
// Does not override default/reserved theme attributes; skips any duplicates from custom_theme_attributes.
1061
+
for (const Variant &k : custom_theme_attributes.keys()) {
1062
+
String key = k;
1063
+
String value = custom_theme_attributes[k];
1064
+
if (key.begins_with("[splash]")) {
1065
+
String splash_key = key.trim_prefix("[splash]");
1066
+
if (splash_theme_attributes.has(splash_key)) {
1067
+
WARN_PRINT(vformat("Skipped custom_theme_attribute '%s'; this is a reserved attribute configured via other export options or project settings.", splash_key));
1068
+
} else {
1069
+
splash_theme_attributes[splash_key] = value;
1070
+
}
1071
+
} else {
1072
+
if (main_theme_attributes.has(key)) {
1073
+
WARN_PRINT(vformat("Skipped custom_theme_attribute '%s'; this is a reserved attribute configured via other export options or project settings.", key));
0 commit comments