Android: Fix text update issues with fullscreen virtual keyboard
In commit 1f6d7cbb341bd79826d3f6d69e1f1a427ebb8f1b, we introduced support for the full-screen software keyboard. However, this revealed issues with text not updating correctly in the view, particularly with composing text. This commit addresses the problem by adding calls of [0]restartInput() in three methods: setComposingText, deleteSurroundingText and setSelection. These calls help synchronize the editable state with the input method and ensure the displayed text remains consistent and up-to-date. There is one more issue that needs to be solved: QTBUG-136229 [0]https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#restartInput(android.view.View) Pick-to: 6.9 6.8 Fixes: QTBUG-135376 Fixes: QTBUG-128745 Fixes: QTBUG-130058 Change-Id: I3f905dd02cb3bfe5046b01164412f328160b7a8b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
parent
bdbe4c8858
commit
ab98013efc
@ -163,15 +163,18 @@ class QtInputConnection extends BaseInputConnection
|
||||
public boolean commitText(CharSequence text, int newCursorPosition)
|
||||
{
|
||||
setClosing(false);
|
||||
boolean result = QtNativeInputConnection.commitText(text.toString(), newCursorPosition);
|
||||
restartImmInput();
|
||||
return QtNativeInputConnection.commitText(text.toString(), newCursorPosition);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteSurroundingText(int leftLength, int rightLength)
|
||||
{
|
||||
setClosing(false);
|
||||
return QtNativeInputConnection.deleteSurroundingText(leftLength, rightLength);
|
||||
boolean result = QtNativeInputConnection.deleteSurroundingText(leftLength, rightLength);
|
||||
restartImmInput();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -304,7 +307,9 @@ class QtInputConnection extends BaseInputConnection
|
||||
public boolean setComposingText(CharSequence text, int newCursorPosition)
|
||||
{
|
||||
setClosing(false);
|
||||
return QtNativeInputConnection.setComposingText(text.toString(), newCursorPosition);
|
||||
boolean result = QtNativeInputConnection.setComposingText(text.toString(), newCursorPosition);
|
||||
restartImmInput();
|
||||
return result;
|
||||
}
|
||||
|
||||
@TargetApi(33)
|
||||
@ -347,6 +352,8 @@ class QtInputConnection extends BaseInputConnection
|
||||
public boolean setSelection(int start, int end)
|
||||
{
|
||||
setClosing(false);
|
||||
return QtNativeInputConnection.setSelection(start, end);
|
||||
boolean result = QtNativeInputConnection.setSelection(start, end);
|
||||
restartImmInput();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user