aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom Palvelev <artyompp@google.com>2024-03-20 20:37:05 +0000
committerArtyom Palvelev <artyompp@google.com>2024-03-20 20:37:05 +0000
commitebafbf53d267673fa35282431f94756e2310976e (patch)
treed1cea52e1ecacd3372b840496037309011745f53
parent95f443a2586686d5b77644b2391fd32523c6ae42 (diff)
downloadgamesdk-ebafbf53d267673fa35282431f94756e2310976e.tar.gz
fixed state updates propagation
State updates should be always propagated, because logic of the text editor should not depend on visibility of IME. Bug: N/A Test: build and run game_test_input_testbed Change-Id: Iae9ca0921e648ad2aa93aad90bb412c5a4296b98
-rw-r--r--game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java b/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
index 07aa9f3c..70527626 100644
--- a/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
+++ b/game-text-input/src/main/java/com/google/androidgamesdk/gametextinput/InputConnection.java
@@ -557,9 +557,9 @@ public class InputConnection
// Keep a reference to the listener to avoid a race condition when setting the listener.
Listener listener = this.listener;
- // Only propagate the state change when the keyboard is set to active.
- // If we don't do this, 'back' events can be passed unnecessarily.
- if (listener != null && this.mSoftKeyboardActive) {
+ // We always propagate state change events because unfortunately keyboard visibility functions
+ // are unreliable, and text editor logic should not depend on them.
+ if (listener != null) {
listener.stateChanged(state, dismissed);
}
}