| 105 | } |
| 106 | |
| 107 | void shareText(const std::string& str) { |
| 108 | Logger::get().log(Logger::LogType::INFO, "[AndroidJNICalls::shareText] Share text " + str); |
| 109 | JNIEnv* env = static_cast<JNIEnv*>(SDL_GetAndroidJNIEnv()); |
| 110 | jni_local_frame(env, 16, [&] { |
| 111 | jobject activity = (jobject) SDL_GetAndroidActivity(); |
| 112 | jclass clazz = env->GetObjectClass(activity); |
| 113 | jmethodID method_id = env->GetStaticMethodID(clazz, "shareText", |
| 114 | "(Ljava/lang/String;)V"); |
| 115 | env->CallStaticVoidMethod(clazz, method_id, string2jstring(env, str)); |
| 116 | }); |
| 117 | } |
| 118 | |
| 119 | int get_android_text_pos_from_cursor_pos(const std::shared_ptr<RichText::TextBox>& t, const RichText::TextPosition& p) { |
| 120 | return t->get_utf16_location_from_codepoint_location(t->get_codepoint_location_from_text_position(p)); |
no test coverage detected