1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Better android input handling: sending notifications about CInputText changes to java so that we can display textinput overlay there; (#354)

This commit is contained in:
Fay
2017-07-23 19:23:48 +02:00
committed by ArseniyShestakov
parent 069f295165
commit 80f149e296
4 changed files with 59 additions and 0 deletions

View File

@@ -83,6 +83,16 @@ std::string CAndroidVMHelper::callStaticStringMethod(const std::string & cls, co
return std::string(env->GetStringUTFChars(jres, nullptr));
}
void CAndroidVMHelper::callCustomMethod(const std::string & cls, const std::string & method,
const std::string & signature,
std::function<void(JNIEnv *, jclass, jmethodID)> fun, bool classloaded)
{
auto env = get();
auto javaHelper = findClass(cls, classloaded);
auto methodId = env->GetStaticMethodID(javaHelper, method.c_str(), signature.c_str());
fun(env, javaHelper, methodId);
}
jclass CAndroidVMHelper::findClass(const std::string & name, bool classloaded)
{
if(classloaded)