|
@@ -488,9 +488,6 @@ CKeyboardFocusListener::CKeyboardFocusListener(CTextInput * textInput)
|
|
|
void CKeyboardFocusListener::focusGot()
|
|
|
{
|
|
|
CSDL_Ext::startTextInput(&textInput->pos);
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- textInput->notifyAndroidTextInputChanged(textInput->text);
|
|
|
-#endif
|
|
|
usageIndex++;
|
|
|
}
|
|
|
|
|
@@ -552,9 +549,6 @@ void CTextInput::keyPressed(const SDL_KeyboardEvent & key)
|
|
|
{
|
|
|
redraw();
|
|
|
cb(text);
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- notifyAndroidTextInputChanged(text);
|
|
|
-#endif
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -563,10 +557,6 @@ void CTextInput::setText(const std::string & nText, bool callCb)
|
|
|
CLabel::setText(nText);
|
|
|
if(callCb)
|
|
|
cb(text);
|
|
|
-
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- notifyAndroidTextInputChanged(text);
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
bool CTextInput::captureThisEvent(const SDL_KeyboardEvent & key)
|
|
@@ -592,10 +582,6 @@ void CTextInput::textInputed(const SDL_TextInputEvent & event)
|
|
|
cb(text);
|
|
|
}
|
|
|
newText.clear();
|
|
|
-
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- notifyAndroidTextInputChanged(text);
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
void CTextInput::textEdited(const SDL_TextEditingEvent & event)
|
|
@@ -606,11 +592,6 @@ void CTextInput::textEdited(const SDL_TextEditingEvent & event)
|
|
|
newText = event.text;
|
|
|
redraw();
|
|
|
cb(text + newText);
|
|
|
-
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
- auto editedText = text + newText;
|
|
|
- notifyAndroidTextInputChanged(editedText);
|
|
|
-#endif
|
|
|
}
|
|
|
|
|
|
void CTextInput::filenameFilter(std::string & text, const std::string &)
|
|
@@ -657,24 +638,6 @@ void CTextInput::numberFilter(std::string & text, const std::string & oldText, i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#ifdef VCMI_ANDROID
|
|
|
-void CTextInput::notifyAndroidTextInputChanged(std::string & text)
|
|
|
-{
|
|
|
- if(!focus)
|
|
|
- return;
|
|
|
-
|
|
|
- auto fun = [&text](JNIEnv * env, jclass cls, jmethodID method)
|
|
|
- {
|
|
|
- auto jtext = env->NewStringUTF(text.c_str());
|
|
|
- env->CallStaticVoidMethod(cls, method, jtext);
|
|
|
- env->DeleteLocalRef(jtext);
|
|
|
- };
|
|
|
- CAndroidVMHelper vmHelper;
|
|
|
- vmHelper.callCustomMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "notifyTextInputChanged",
|
|
|
- "(Ljava/lang/String;)V", fun, true);
|
|
|
-}
|
|
|
-#endif //VCMI_ANDROID
|
|
|
-
|
|
|
CFocusable::CFocusable()
|
|
|
:CFocusable(std::make_shared<IFocusListener>())
|
|
|
{
|