fix(android/engine): Dismiss key preview and subkeys on globe action

This commit is contained in:
Darcy Wong 2022-10-27 08:29:36 +07:00
parent 24d1e4b384
commit aa09bee50e

View file

@ -2177,6 +2177,15 @@ public final class KMManager {
* @param keyboardType KeyboardType KEYBOARD_TYPE_INAPP or KEYBOARD_TYPE_SYSTEM
*/
public static void handleGlobeKeyAction(Context context, boolean globeKeyDown, KeyboardType keyboardType) {
// Clear preview and subkeys
if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) {
InAppKeyboard.dismissKeyPreview(0);
InAppKeyboard.dismissSubKeysWindow();
} else if (keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM) {
SystemKeyboard.dismissKeyPreview(0);
SystemKeyboard.dismissSubKeysWindow();
}
// Update globeKeyState
if (globeKeyState != GlobeKeyState.GLOBE_KEY_STATE_LONGPRESS) {
globeKeyState = globeKeyDown ? GlobeKeyState.GLOBE_KEY_STATE_DOWN : GlobeKeyState.GLOBE_KEY_STATE_UP;