You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #109267 from syntaxerror247/misc
Android: Misc changes
This commit is contained in:
@@ -1069,12 +1069,13 @@ void EditorFileSystem::scan() {
|
||||
if (first_scan) {
|
||||
_first_scan_filesystem();
|
||||
#ifdef ANDROID_ENABLED
|
||||
// Create a .nomedia file to hide assets from media apps on Android.
|
||||
// Android 11 has some issues with nomedia files, so it's disabled there. See GH-106479 and GH-105399 for details.
|
||||
// NOTE: Nomedia file is also handled in project manager. See project_dialog.cpp -> ProjectDialog::ok_pressed().
|
||||
String sdk_version = OS::get_singleton()->get_version().get_slicec('.', 0);
|
||||
if (sdk_version != "30") {
|
||||
const String nomedia_file_path = ProjectSettings::get_singleton()->get_resource_path().path_join(".nomedia");
|
||||
if (!FileAccess::exists(nomedia_file_path)) {
|
||||
// Create a .nomedia file to hide assets from media apps on Android.
|
||||
Ref<FileAccess> f = FileAccess::open(nomedia_file_path, FileAccess::WRITE);
|
||||
if (f.is_null()) {
|
||||
// .nomedia isn't so critical.
|
||||
|
||||
@@ -739,10 +739,11 @@ void ProjectDialog::ok_pressed() {
|
||||
hide();
|
||||
if (mode == MODE_NEW || mode == MODE_IMPORT || mode == MODE_INSTALL) {
|
||||
#ifdef ANDROID_ENABLED
|
||||
// Create a .nomedia file to hide assets from media apps on Android.
|
||||
// Android 11 has some issues with nomedia files, so it's disabled there. See GH-106479, GH-105399 for details.
|
||||
// NOTE: Nomedia file is also handled during the first filesystem scan. See editor_file_system.cpp -> EditorFileSystem::scan().
|
||||
String sdk_version = OS::get_singleton()->get_version().get_slicec('.', 0);
|
||||
if (sdk_version != "30") {
|
||||
// Create a .nomedia file to hide assets from media apps on Android.
|
||||
const String nomedia_file_path = path.path_join(".nomedia");
|
||||
Ref<FileAccess> f2 = FileAccess::open(nomedia_file_path, FileAccess::WRITE);
|
||||
if (f2.is_null()) {
|
||||
|
||||
@@ -2176,11 +2176,11 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "gesture/swipe_to_dismiss"), false));
|
||||
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/edge_to_edge"), false));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_normal"), true));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/edge_to_edge"), false));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::COLOR, "screen/background_color", PROPERTY_HINT_COLOR_NO_ALPHA), Color()));
|
||||
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data_backup/allow"), false));
|
||||
@@ -3103,6 +3103,9 @@ void EditorExportPlatformAndroid::get_command_line_flags(const Ref<EditorExportP
|
||||
}
|
||||
|
||||
String background_color = "#" + p_preset->get("screen/background_color").operator Color().to_html(false);
|
||||
|
||||
// For Gradle build, _fix_themes_xml() sets background to transparent if _is_transparency_allowed().
|
||||
// Overriding to transparent here too as it's used as fallback for system bar appearance.
|
||||
if (_is_transparency_allowed(p_preset) && p_preset->get("gradle_build/use_gradle_build")) {
|
||||
background_color = "#00000000";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user