diff --git a/build-profile.json5 b/build-profile.json5 index 2c9436e52be68129f750f04d63b8a1f5bba68062..729f24d576b37eebf363d8ed218fc341f0272bdf 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 16c380813b5aeda4f88a70c57d3cd18715dc0dfe..74198f8088954710f4438a013ad67f084ebe19c4 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