From 7927b14090eeababb2847e63103b88a25269d773 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Mon, 9 Sep 2024 10:56:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9TextInputPlugins=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E5=92=8CAndroid=E4=B8=80=E8=87=B4=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=96=B9=E6=B3=95=20=E4=BF=AE=E6=94=B9canShowTextInpu?= =?UTF-8?q?t=E8=BF=94=E5=9B=9E=E6=B0=B8=E8=BF=9C=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=94=B9TextField?= =?UTF-8?q?=E8=AE=BE=E7=BD=AETextInputType.none=E6=97=B6=E4=BE=9D=E7=84=B6?= =?UTF-8?q?=E4=BC=9A=E5=87=BA=E7=8E=B0=E8=BD=AF=E9=94=AE=E7=9B=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangxiaoyao <976125628@qq.com> --- .../ets/plugin/editing/TextInputPlugin.ets | 115 ++++++------------ 1 file changed, 40 insertions(+), 75 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets index 8bf6fcbbbf..166c3ff016 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets @@ -27,6 +27,7 @@ import { window } from '@kit.ArkUI'; import FlutterManager from '../../embedding/ohos/FlutterManager'; import { IntentionCode } from '@ohos.multimodalInput.intentionCode'; import {KeyCode} from '@kit.InputKit'; +import { BusinessError } from '@kit.BasicServicesKit'; /// 临时规避缺少newline对应枚举问题 const NEWLINE_KEY_TYPE: number = 8; @@ -84,7 +85,8 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { private mRestartInputPending: boolean = false; private plugin: EditingStateWatcher | Any; private imcFlag: boolean = false; - private showType: keyboardType = keyboardType.ENTRY + private inputTypeNone: string = 'NONE' + private screenHeight: number = 0 constructor(plugin: TextInputPlugin | Any) { this.textConfig = { @@ -97,11 +99,15 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.mEditable = new ListenableEditingState(null, 0); this.inputMethodController = inputMethod.getController(); this.inputTarget = new InputTarget(Type.NO_TARGET, 0); - this.listenShowKeyboardHeight(); + this.getKeyboardView() } show(): void { - this.showTextInput(); + if (this.canShowTextInput()) { + this.showTextInput(); + } else { + this.hide(); + } } hide(): void { @@ -142,33 +148,11 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } private async showTextInput(): Promise { - /// 暂时规避方案 - /// NONE是打开软键盘,正常输入模式 - /// ENTRY是未弹出软键盘时的输入模式 - /// TRANSFER负责切换同一个页面内的TextField时重置键盘 - /// DONE是解决点击Entry时submitted回调使用弹窗而无法正常收起软键盘 - switch (this.showType) { - case keyboardType.NONE: - break; - case keyboardType.ENTRY: - this.showKeyboard(); - break; - case keyboardType.TRANSFER: - this.showKeyboard(); - break; - case keyboardType.DONE: - this.hideTextInput(); - break; - default: - break; + if (this.screenHeight != 0) { + return } - } - - async showKeyboard() { - /// 添加软键盘弹出收起监听方法 - this.listenShowKeyboardHeight(); await this.attach(true); - if (this.imcFlag != true) { + if (!this.imcFlag) { this.listenKeyBoardEvent(); } this.inputMethodController.showTextInput().then(() => { @@ -176,35 +160,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { }).catch((err: Any) => { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to show softKeyboard:" + JSON.stringify(err)); }); - this.showType = keyboardType.NONE; - } - - listenShowKeyboardHeight() { - window.getLastWindow(getContext(this)).then(currentWindow => { - try { - currentWindow.on('keyboardHeightChange', (data) => { - console.info('Succeeded in enabling the listener for keyboard height changes. Data: ' + JSON.stringify(data)); - if (data == 0) { - this.showType = keyboardType.ENTRY - } else { - this.showType = keyboardType.NONE - } - }); - } catch (exception) { - console.error(`Failed to enable the listener for keyboard height changes. Cause code: ${exception.code}, message: ${exception.message}`); - } - }) - } - - /// 软键盘收起时关闭监听方法 - listenHideKeyboardHeight() { - window.getLastWindow(getContext(this)).then(currentWindow => { - try { - currentWindow.off('keyboardHeightChange'); - } catch (exception) { - console.error(`Failed to enable the listener for keyboard height changes. Cause code: ${exception.code}, message: ${exception.message}`); - } - }) } private async hideTextInput(): Promise { @@ -213,10 +168,34 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { }).catch((err: Any) => { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to hide softKeyboard:" + JSON.stringify(err)); }) - this.showType = keyboardType.ENTRY - this.listenHideKeyboardHeight() } + getKeyboardView(): void { + try { + let windowStage = FlutterManager.getInstance() + .getWindowStage(FlutterManager.getInstance().getUIAbility(getContext(this))); + windowStage.getMainWindow((err: BusinessError, currentWindow ) => { + let property = currentWindow .getWindowProperties(); + let avoidArea = currentWindow .getWindowAvoidArea(window.AvoidAreaType.TYPE_KEYBOARD); + // 初始化显示区域高度 + this.screenHeight = px2vp(property.windowRect.height - avoidArea.bottomRect.height); + // 监视软键盘的弹出和收起 + currentWindow.on('avoidAreaChange', async data => { + if (data.type !== window.AvoidAreaType.TYPE_KEYBOARD) { + return; + } + if (data.area.bottomRect.height == 0) { + this.screenHeight = 0; + } else { + this.screenHeight = px2vp(property.windowRect.height - data.area.bottomRect.height); + } + }) + }); + } catch (err) { + Log.e(TextInputMethodHandlerImpl.TAG, "Failed to attach:" + JSON.stringify(err)); + } + } + async attach(showKeyboard: boolean): Promise { try { await this.inputMethodController.attach(showKeyboard, this.textConfig); @@ -260,13 +239,14 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.mRestartInputPending = true; this.mEditable.addEditingStateListener(this.plugin); + this.screenHeight = 0; } canShowTextInput(): boolean { if (this.configuration == null || this.configuration.inputType == null) { return true; } - return this.configuration.inputType.type != TextInputType.NONE; + return this.configuration.inputType.type != this.inputTypeNone; } listenKeyBoardEvent(): void { @@ -312,8 +292,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { /// 临时规避缺少newline对应枚举类型问题 if (functionKey.enterKeyType == NEWLINE_KEY_TYPE) { this.mEditable.handleNewlineEvent(); - } else { - this.showType = keyboardType.DONE } this.mEditable.handleFunctionKey(functionKey); }) @@ -327,9 +305,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.inputMethodController.on('sendKeyboardStatus', (state) => { if (state == inputMethod.KeyboardStatus.HIDE) { this.plugin.textInputChannel.onConnectionClosed(this.inputTarget.id); - if (this.showType != keyboardType.DONE) { - this.showType = keyboardType.TRANSFER - } this.hideTextInput() this.cancelListenKeyBoardEvent() } @@ -389,9 +364,6 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.mEditable.removeEditingStateListener(this.plugin); this.configuration = null; this.inputTarget = new InputTarget(Type.NO_TARGET, 0); - if (this.showType != keyboardType.DONE) { - this.showType = keyboardType.TRANSFER - } this.resetAttach(); } } @@ -406,13 +378,6 @@ enum Type { PHYSICAL_DISPLAY_PLATFORM_VIEW, } -enum keyboardType { - NONE, - ENTRY, - TRANSFER, - DONE -} - export class InputTarget { type: Type; id: number; -- Gitee From 0f4064672321a9e48f6f12e3171718bb1d5a1ff6 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Mon, 9 Sep 2024 10:59:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangxiaoyao <976125628@qq.com> --- .../flutter/src/main/ets/plugin/editing/TextInputPlugin.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets index 166c3ff016..4f838c9c15 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets @@ -194,7 +194,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to attach:" + JSON.stringify(err)); } - } + } async attach(showKeyboard: boolean): Promise { try { -- Gitee From f771a3921f6171c5e5ac618e2028492e89d26e94 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Mon, 9 Sep 2024 14:09:56 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9TextInputPlugin=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E7=9A=84=E6=B3=A8=E9=94=80=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E5=8F=AA=E6=B3=A8=E9=94=80=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E6=B3=A8=E9=94=80=E5=85=A8=E5=B1=80=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangxiaoyao <976125628@qq.com> --- .../ets/plugin/editing/TextInputPlugin.ets | 153 ++++++++++-------- 1 file changed, 86 insertions(+), 67 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets index 4f838c9c15..b792afba5d 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets @@ -86,7 +86,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { private plugin: EditingStateWatcher | Any; private imcFlag: boolean = false; private inputTypeNone: string = 'NONE' - private screenHeight: number = 0 + private firstShow: boolean = true; constructor(plugin: TextInputPlugin | Any) { this.textConfig = { @@ -99,9 +99,9 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.mEditable = new ListenableEditingState(null, 0); this.inputMethodController = inputMethod.getController(); this.inputTarget = new InputTarget(Type.NO_TARGET, 0); - this.getKeyboardView() } + /// 通过判断是否是TextInputType.none来决定是否弹出键盘 show(): void { if (this.canShowTextInput()) { this.showTextInput(); @@ -148,9 +148,10 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } private async showTextInput(): Promise { - if (this.screenHeight != 0) { + if (!this.firstShow) { return } + this.listenShowKeyboard() await this.attach(true); if (!this.imcFlag) { this.listenKeyBoardEvent(); @@ -164,36 +165,30 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { private async hideTextInput(): Promise { this.inputMethodController.hideTextInput().then(() => { + this.firstShow = true Log.d(TextInputMethodHandlerImpl.TAG, "Succeeded in hide softKeyboard"); }).catch((err: Any) => { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to hide softKeyboard:" + JSON.stringify(err)); }) + this.listenNoShowKeyboard() } - getKeyboardView(): void { - try { - let windowStage = FlutterManager.getInstance() - .getWindowStage(FlutterManager.getInstance().getUIAbility(getContext(this))); - windowStage.getMainWindow((err: BusinessError, currentWindow ) => { - let property = currentWindow .getWindowProperties(); - let avoidArea = currentWindow .getWindowAvoidArea(window.AvoidAreaType.TYPE_KEYBOARD); - // 初始化显示区域高度 - this.screenHeight = px2vp(property.windowRect.height - avoidArea.bottomRect.height); - // 监视软键盘的弹出和收起 - currentWindow.on('avoidAreaChange', async data => { - if (data.type !== window.AvoidAreaType.TYPE_KEYBOARD) { - return; - } - if (data.area.bottomRect.height == 0) { - this.screenHeight = 0; - } else { - this.screenHeight = px2vp(property.windowRect.height - data.area.bottomRect.height); - } - }) - }); - } catch (err) { - Log.e(TextInputMethodHandlerImpl.TAG, "Failed to attach:" + JSON.stringify(err)); - } + /// 通过监听规避区域内,是否有软键盘区域来进行监听。该方法在回到桌面和锁屏依然可以正常监听 + listenShowKeyboard() { + let windowStage = FlutterManager.getInstance() + .getWindowStage(FlutterManager.getInstance().getUIAbility(getContext(this))); + windowStage.getMainWindow((err: BusinessError, currentWindow ) => { + currentWindow.on('avoidAreaChange', this.avoidAreaChangeCallback) + }); + } + + /// 取消监听规避区域的软键盘范围 + listenNoShowKeyboard() { + let windowStage = FlutterManager.getInstance() + .getWindowStage(FlutterManager.getInstance().getUIAbility(getContext(this))); + windowStage.getMainWindow((err: BusinessError, currentWindow ) => { + currentWindow.off('avoidAreaChange', this.avoidAreaChangeCallback) + }); } async attach(showKeyboard: boolean): Promise { @@ -239,7 +234,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.mRestartInputPending = true; this.mEditable.addEditingStateListener(this.plugin); - this.screenHeight = 0; + this.firstShow = true } canShowTextInput(): boolean { @@ -251,10 +246,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { listenKeyBoardEvent(): void { try { - this.inputMethodController.on('insertText', (text) => { - Log.d(TextInputMethodHandlerImpl.TAG, "insertText: " + text); - this.mEditable.handleInsertTextEvent(text); - }); + this.inputMethodController.on('insertText', this.insertTextCallback); } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe insertText:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -262,15 +254,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } try { - this.inputMethodController.on('deleteLeft', (length) => { - /// 暂时规避方案 - /// OS机制与Android不一致,需要去监听软键盘事件才能发送KeyEvent事件 - if (this.mEditable.getStringCache() == "") { - this.sendKeyboardEvent(KeyType.Down, KeyCode.KEYCODE_DEL) - this.sendKeyboardEvent(KeyType.Up, KeyCode.KEYCODE_DEL) - } - this.mEditable.handleDeleteEvent(false, length); - }) + this.inputMethodController.on('deleteLeft', this.deleteLeftCallback) } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe deleteLeft:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -278,9 +262,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } try { - this.inputMethodController.on('deleteRight', (length) => { - this.mEditable.handleDeleteEvent(true, length); - }) + this.inputMethodController.on('deleteRight', this.deleteRightCallback) } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe deleteRight:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -288,13 +270,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } try { - this.inputMethodController.on('sendFunctionKey', (functionKey) => { - /// 临时规避缺少newline对应枚举类型问题 - if (functionKey.enterKeyType == NEWLINE_KEY_TYPE) { - this.mEditable.handleNewlineEvent(); - } - this.mEditable.handleFunctionKey(functionKey); - }) + this.inputMethodController.on('sendFunctionKey', this.sendFunctionKeyCallback) } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe sendFunctionKey:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -302,13 +278,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } try { - this.inputMethodController.on('sendKeyboardStatus', (state) => { - if (state == inputMethod.KeyboardStatus.HIDE) { - this.plugin.textInputChannel.onConnectionClosed(this.inputTarget.id); - this.hideTextInput() - this.cancelListenKeyBoardEvent() - } - }) + this.inputMethodController.on('sendKeyboardStatus', this.sendKeyboardStatusCallback) } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe sendKeyboardStatus:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -316,9 +286,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { } try { - this.inputMethodController.on('selectByRange', (range: inputMethod.Range) => { - this.mEditable.handleSelectByRange(range); - }) + this.inputMethodController.on('selectByRange', this.selectByRangeCallback) } catch (err) { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to subscribe selectByRange:" + JSON.stringify(err)); this.cancelListenKeyBoardEvent(); @@ -347,13 +315,64 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { }) } + private avoidAreaChangeCallback = (data: window.AvoidAreaOptions) => { + console.info('Succeeded in enabling the listener for keyboard height changes. Data: ' + JSON.stringify(data)); + if (data.type !== window.AvoidAreaType.TYPE_KEYBOARD) { + return; + } + if (data.area.bottomRect.height == 0) { + this.firstShow = true + } else { + this.firstShow = false + } + } + + private insertTextCallback = (text: string) => { + Log.d(TextInputMethodHandlerImpl.TAG, "insertText: " + text); + this.mEditable.handleInsertTextEvent(text); + } + + private deleteLeftCallback = (length: number) => { + /// 暂时规避方案 + /// OS机制与Android不一致,需要去监听软键盘事件才能发送KeyEvent事件 + if (this.mEditable.getStringCache() == "") { + this.sendKeyboardEvent(KeyType.Down, KeyCode.KEYCODE_DEL) + this.sendKeyboardEvent(KeyType.Up, KeyCode.KEYCODE_DEL) + } + this.mEditable.handleDeleteEvent(false, length); + } + + private deleteRightCallback = (length: number) => { + this.mEditable.handleDeleteEvent(true, length); + } + + private sendFunctionKeyCallback = (functionKey: inputMethod.FunctionKey) => { + /// 临时规避缺少newline对应枚举类型问题 + if (functionKey.enterKeyType == NEWLINE_KEY_TYPE) { + this.mEditable.handleNewlineEvent(); + } + this.mEditable.handleFunctionKey(functionKey); + } + + private sendKeyboardStatusCallback = (state: inputMethod.KeyboardStatus) => { + if (state == inputMethod.KeyboardStatus.HIDE) { + this.plugin.textInputChannel.onConnectionClosed(this.inputTarget.id); + this.hideTextInput() + this.cancelListenKeyBoardEvent() + } + } + + private selectByRangeCallback = (range: inputMethod.Range) => { + this.mEditable.handleSelectByRange(range); + } + cancelListenKeyBoardEvent(): void { - this.inputMethodController.off('insertText'); - this.inputMethodController.off('deleteLeft'); - this.inputMethodController.off('deleteRight'); - this.inputMethodController.off('sendFunctionKey'); - this.inputMethodController.off('sendKeyboardStatus'); - this.inputMethodController.off('selectByRange'); + this.inputMethodController.off('insertText', this.insertTextCallback); + this.inputMethodController.off('deleteLeft', this.deleteLeftCallback); + this.inputMethodController.off('deleteRight', this.deleteRightCallback); + this.inputMethodController.off('sendFunctionKey', this.sendFunctionKeyCallback); + this.inputMethodController.off('sendKeyboardStatus', this.sendKeyboardStatusCallback); + this.inputMethodController.off('selectByRange', this.selectByRangeCallback); this.imcFlag = false; } -- Gitee From cfb07b8bea51796b4ace88672d071bbc2d2033e3 Mon Sep 17 00:00:00 2001 From: laoguanyao <806103474@qq.com> Date: Mon, 9 Sep 2024 14:24:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangxiaoyao <976125628@qq.com> --- .../flutter/src/main/ets/plugin/editing/TextInputPlugin.ets | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets index b792afba5d..aba17a326c 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextInputPlugin.ets @@ -157,6 +157,7 @@ class TextInputMethodHandlerImpl implements TextInputMethodHandler { this.listenKeyBoardEvent(); } this.inputMethodController.showTextInput().then(() => { + this.firstShow = false Log.d(TextInputMethodHandlerImpl.TAG, "Succeeded in showing softKeyboard"); }).catch((err: Any) => { Log.e(TextInputMethodHandlerImpl.TAG, "Failed to show softKeyboard:" + JSON.stringify(err)); -- Gitee