From 0e0dd0b5a2cdb528ddd4489f739cc0460d1aeb17 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Sun, 16 Jun 2024 23:29:25 +0000 Subject: [PATCH] Support `VIEW` intents on Android. (#1799) * Add Drop file event support for android. * Updated MIME type configuration and intent filter generation. * "supportedMimeTypes" => "mimeType" * `mimeType` -> `accept-file-intent` --- .../android/template/app/src/main/AndroidManifest.xml | 10 ++++++++++ tools/platforms/AndroidPlatform.hx | 1 + 2 files changed, 11 insertions(+) diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml index 501db19f7..efc8132cc 100644 --- a/templates/android/template/app/src/main/AndroidManifest.xml +++ b/templates/android/template/app/src/main/AndroidManifest.xml @@ -25,6 +25,16 @@ + ::foreach ANDROID_ACCEPT_FILE_INTENT:: + + + + + + + + ::end:: + diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 7ab9433bd..dd12ac97f 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -493,6 +493,7 @@ class AndroidPlatform extends PlatformTarget "android:configChanges": project.config.getArrayString("android.configChanges", ["keyboardHidden", "orientation", "screenSize", "screenLayout", "uiMode"]).join("|"), "android:screenOrientation": project.window.orientation == PORTRAIT ? "sensorPortrait" : (project.window.orientation == LANDSCAPE ? "sensorLandscape" : null) }); + context.ANDROID_ACCEPT_FILE_INTENT = project.config.getArrayString("android.accept-file-intent", []); if (!project.environment.exists("ANDROID_SDK") || !project.environment.exists("ANDROID_NDK_ROOT")) {