diff options
Diffstat (limited to 'platform/android/java_godot_wrapper.cpp')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index a01a74f1fd..1703179b8e 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -62,6 +62,8 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ _finish = p_env->GetMethodID(godot_class, "forceQuit", "(I)Z"); _set_keep_screen_on = p_env->GetMethodID(godot_class, "setKeepScreenOn", "(Z)V"); _alert = p_env->GetMethodID(godot_class, "alert", "(Ljava/lang/String;Ljava/lang/String;)V"); + _is_dark_mode_supported = p_env->GetMethodID(godot_class, "isDarkModeSupported", "()Z"); + _is_dark_mode = p_env->GetMethodID(godot_class, "isDarkMode", "()Z"); _get_clipboard = p_env->GetMethodID(godot_class, "getClipboard", "()Ljava/lang/String;"); _set_clipboard = p_env->GetMethodID(godot_class, "setClipboard", "(Ljava/lang/String;)V"); _has_clipboard = p_env->GetMethodID(godot_class, "hasClipboard", "()Z"); @@ -172,6 +174,26 @@ void GodotJavaWrapper::alert(const String &p_message, const String &p_title) { } } +bool GodotJavaWrapper::is_dark_mode_supported() { + if (_is_dark_mode_supported) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_NULL_V(env, false); + return env->CallBooleanMethod(godot_instance, _is_dark_mode_supported); + } else { + return false; + } +} + +bool GodotJavaWrapper::is_dark_mode() { + if (_is_dark_mode) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_NULL_V(env, false); + return env->CallBooleanMethod(godot_instance, _is_dark_mode); + } else { + return false; + } +} + bool GodotJavaWrapper::has_get_clipboard() { return _get_clipboard != nullptr; } |