@@ -79,7 +79,11 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
79
79
/*
80
80
Calculate new sizes and positions
81
81
*/
82
+ #ifdef __ANDROID__
83
+ const float s = m_gui_scale * porting::getDisplayDensity () / 2 ;
84
+ #else
82
85
const float s = m_gui_scale;
86
+ #endif
83
87
DesiredRect = core::rect<s32>(
84
88
screensize.X / 2 - 580 * s / 2 ,
85
89
screensize.Y / 2 - 300 * s / 2 ,
@@ -289,19 +293,24 @@ bool GUIPasswordChange::getAndroidUIInput()
289
293
if (!hasAndroidUIInput ())
290
294
return false ;
291
295
296
+ // still waiting
297
+ if (porting::getInputDialogState () == -1 )
298
+ return true ;
299
+
292
300
gui::IGUIElement *e = nullptr ;
293
301
if (m_jni_field_name == " old_password" )
294
302
e = getElementFromId (ID_oldPassword);
295
303
else if (m_jni_field_name == " new_password_1" )
296
304
e = getElementFromId (ID_newPassword1);
297
305
else if (m_jni_field_name == " new_password_2" )
298
306
e = getElementFromId (ID_newPassword2);
299
-
300
- if (e) {
301
- std::string text = porting::getInputDialogValue ();
302
- e->setText (utf8_to_wide (text).c_str ());
303
- }
304
307
m_jni_field_name.clear ();
308
+
309
+ if (!e || e->getType () != irr::gui::EGUIET_EDIT_BOX)
310
+ return false ;
311
+
312
+ std::string text = porting::getInputDialogValue ();
313
+ e->setText (utf8_to_wide (text).c_str ());
305
314
return false ;
306
315
}
307
316
#endif
0 commit comments