summaryrefslogtreecommitdiffstats
path: root/platform/android/java_godot_lib_jni.cpp
diff options
context:
space:
mode:
authorAnish Mishra <mishragames@gmail.com>2024-10-27 16:29:55 +0530
committerAnish Mishra <mishragames@gmail.com>2024-10-29 20:02:08 +0530
commitbe5d7f757d70596f628c9ac8a3cba8412cc34fa7 (patch)
tree7de9efdc93d15884106470b0b134db6836fd2ddb /platform/android/java_godot_lib_jni.cpp
parent08f9cba0fbf27f171dea55de6f8274928b9f0d84 (diff)
downloadredot-engine-be5d7f757d70596f628c9ac8a3cba8412cc34fa7.tar.gz
[Android] Implement native input dialog support
Diffstat (limited to 'platform/android/java_godot_lib_jni.cpp')
-rw-r--r--platform/android/java_godot_lib_jni.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp
index 1a256959cd..997534ada3 100644
--- a/platform/android/java_godot_lib_jni.cpp
+++ b/platform/android/java_godot_lib_jni.cpp
@@ -540,6 +540,14 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onNightModeChanged(JN
}
}
+JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_inputDialogCallback(JNIEnv *env, jclass clazz, jstring p_text) {
+ DisplayServerAndroid *ds = (DisplayServerAndroid *)DisplayServer::get_singleton();
+ if (ds) {
+ String text = jstring_to_string(p_text, env);
+ ds->emit_input_dialog_callback(text);
+ }
+}
+
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) {
String permission = jstring_to_string(p_permission, env);
if (permission == "android.permission.RECORD_AUDIO" && p_result) {