From 8f7755a5efe1769cf79871d00badebdc80130e86 Mon Sep 17 00:00:00 2001 From: kuangning <2540487435@qq.com> Date: Thu, 8 May 2025 11:08:39 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Aapi=E5=8D=87=E7=BA=A7=E8=87=B316?= =?UTF-8?q?=EF=BC=8C=E5=BA=9F=E5=BC=83api=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 2 +- features/home/src/main/ets/view/CommentKeyboard.ets | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build-profile.json5 b/build-profile.json5 index 2c9436e..729f24d 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -5,7 +5,7 @@ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": "5.0.0(12)", + "compatibleSdkVersion": "5.0.4(16)", "runtimeOS": "HarmonyOS", "buildOption": { "strictMode": { diff --git a/features/home/src/main/ets/view/CommentKeyboard.ets b/features/home/src/main/ets/view/CommentKeyboard.ets index 16c3808..74198f8 100644 --- a/features/home/src/main/ets/view/CommentKeyboard.ets +++ b/features/home/src/main/ets/view/CommentKeyboard.ets @@ -55,26 +55,26 @@ export struct CommentKeyboard { @Consume navDialogPageInfos: NavPathStack; aboutToAppear(): void { - window.getLastWindow(getContext(this)).then(win => { + window.getLastWindow(this.getUIContext().getHostContext()).then(win => { this.addKeyboardHeightListener(win); }); } aboutToDisappear(): void { - window.getLastWindow(getContext(this)).then(win => { + window.getLastWindow(this.getUIContext().getHostContext()).then(win => { this.removeKeyboardHeightListener(win); }); } getResourceString(resource: Resource): string { - return getContext(this).resourceManager.getStringSync(resource.id); + return this.getUIContext().getHostContext()!.resourceManager.getStringSync(resource.id); } addKeyboardHeightListener(win: window.Window) { win.on('keyboardHeightChange', height => { - console.info('keyboard height has changed', px2vp(height)); + console.info('keyboard height has changed', this.getUIContext().px2vp(height)); if (height !== 0) { - this.keyboardHeight = px2vp(height); + this.keyboardHeight = this.getUIContext().px2vp(height); return; } // if close keyboard, don't set keyboardHeight, avoid EmojiKeyboard height is 0 -- Gitee