From 3f4373dca6a859af4c9cc24ccae2812d7e66cf12 Mon Sep 17 00:00:00 2001 From: 15871369330 <@Gitee31415926535> Date: Tue, 3 Sep 2024 14:31:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=BB=E4=B8=AD=E7=94=BB=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E5=AE=9E=E7=8E=B0=20=E4=B8=AD=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/VideoPlay.ets | 15 +++---- .../main/resources/base/element/string.json | 42 ++++++++++--------- .../main/resources/en_US/element/string.json | 38 +++++++++-------- .../main/resources/zh_CN/element/string.json | 4 ++ 4 files changed, 56 insertions(+), 43 deletions(-) diff --git a/entry/src/main/ets/pages/VideoPlay.ets b/entry/src/main/ets/pages/VideoPlay.ets index 90e7e42..302da59 100644 --- a/entry/src/main/ets/pages/VideoPlay.ets +++ b/entry/src/main/ets/pages/VideoPlay.ets @@ -41,7 +41,7 @@ function msgType() { export struct PlayVideo { @Consume('pageInfos') pageInfos: NavPathStack; @State curState: string = ''; - @State curError: string = ''; + @State curError: ResourceStr = ''; @State buttonAction: string = ''; @State isAutoPull: boolean = false; @State isLightBackground: boolean = false; @@ -110,25 +110,25 @@ export struct PlayVideo { switch (state) { case PiPWindow.PiPState.ABOUT_TO_START: this.curState = 'ABOUT_TO_START'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.STARTED: this.curState = 'STARTED'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ABOUT_TO_STOP: this.curState = 'ABOUT_TO_STOP'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.STOPPED: this.player?.updatePlayStatus(true); this.player?.play(); this.curState = 'STOPPED'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ABOUT_TO_RESTORE: this.curState = 'ABOUT_TO_RESTORE'; - this.curError = Constants.ERROR_BY_DEFAULT; + this.curError = $r('app.string.current_error_hint'); break; case PiPWindow.PiPState.ERROR: this.curState = 'ERROR'; @@ -270,8 +270,9 @@ export struct PlayVideo { CallbackMessage() { Column({ space: Constants.SPACE }) { Text($r('app.string.callback_message')) + .width(Constants.CONTROL_WIDTH) .fontColor($r('app.color.Text_color')) - .padding({ right: $r('app.integer.callback_text_padding') }) + .padding({ left: $r('app.integer.other_padding') }) Column() { Text($r('app.string.current_status')) .textType() diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 0750311..524d7ae 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "module_desc", - "value": "模块描述" + "value": "module description" }, { "name": "EntryAbility_desc", @@ -14,67 +14,71 @@ }, { "name": "video1", - "value": "视频1" + "value": "Video1" }, { "name": "video2", - "value": "视频2" + "value": "Video2" }, { "name": "video3", - "value": "视频3" + "value": "Video3" }, { "name": "video4", - "value": "视频4" + "value": "Video4" }, { "name": "video5", - "value": "视频5" + "value": "Video5" }, { - "name": "video6", - "value": "视频6" + "name": "video6", + "value": "Video6" }, { "name": "video7", - "value": "视频7" + "value": "Video7" }, { "name": "pip_demo", - "value": "画中画示例" + "value": "WindowPiP" }, { "name": "start", - "value": "开启" + "value": "Start" }, { "name": "stop", - "value": "关闭" + "value": "Stop" }, { "name": "auto", - "value": "自动启动画中画" + "value": "Auto" }, { "name": "current_status", - "value": "当前状态:" + "value": "Current Status" }, { - "name": "current_error", - "value": "错误原因:" + "name": "current_error", + "value": "Current Error" }, { "name": "current_action", - "value": "按钮事件和状态:" + "value": "Current Action" }, { "name": "callback_message", - "value": "回调信息" + "value": "Callback Message" }, { "name": "current_video_pip_play", - "value": "当前视频正在画中画播放" + "value": "Current Video Pip Play" + }, + { + "name": "current_error_hint", + "value": "Without" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index 79783e1..524d7ae 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -10,71 +10,75 @@ }, { "name": "EntryAbility_label", - "value": "WimdowPiP" + "value": "WindowPiP" }, { "name": "video1", - "value": "video1" + "value": "Video1" }, { "name": "video2", - "value": "video2" + "value": "Video2" }, { "name": "video3", - "value": "video3" + "value": "Video3" }, { "name": "video4", - "value": "video4" + "value": "Video4" }, { "name": "video5", - "value": "video5" + "value": "Video5" }, { "name": "video6", - "value": "video6" + "value": "Video6" }, { "name": "video7", - "value": "video7" + "value": "Video7" }, { "name": "pip_demo", - "value": "pipDemo" + "value": "WindowPiP" }, { "name": "start", - "value": "start" + "value": "Start" }, { "name": "stop", - "value": "stop" + "value": "Stop" }, { "name": "auto", - "value": "auto" + "value": "Auto" }, { "name": "current_status", - "value": "current status" + "value": "Current Status" }, { "name": "current_error", - "value": "current error" + "value": "Current Error" }, { "name": "current_action", - "value": "current action" + "value": "Current Action" }, { "name": "callback_message", - "value": "callback message" + "value": "Callback Message" }, { "name": "current_video_pip_play", - "value": "current video pip play" + "value": "Current Video Pip Play" + }, + { + "name": "current_error_hint", + "value": "Without" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index c1d6a5a..3e368b8 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -76,6 +76,10 @@ { "name": "current_video_pip_play", "value": "当前视频正在画中画播放" + }, + { + "name": "current_error_hint", + "value": "无" } ] } \ No newline at end of file -- Gitee From 6c0e21d02eee90da1f2eddbbd5ede1dc652f2c05 Mon Sep 17 00:00:00 2001 From: XX Date: Tue, 3 Sep 2024 16:06:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnavigation=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E8=BF=9B=E7=A8=8B=E6=97=B6=E9=97=B4=E4=B8=8D=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: XX --- entry/src/main/ets/pages/WindowPip.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/src/main/ets/pages/WindowPip.ets b/entry/src/main/ets/pages/WindowPip.ets index f7cc5f8..02f9151 100644 --- a/entry/src/main/ets/pages/WindowPip.ets +++ b/entry/src/main/ets/pages/WindowPip.ets @@ -36,7 +36,7 @@ struct ImageWidthTitle { .alignItems(HorizontalAlign.Start) .onClick(() => { getContext().eventHub.emit('onStateChange', true); - this.pageInfos?.pushPath({ name: Constants.NAV_DESTINATION_NAME }); + this.pageInfos?.pushPath({ name: Constants.NAV_DESTINATION_NAME }, { launchMode: 3 }); }) .onAreaChange((oldArea, newArea) => { let width = newArea.width as number; -- Gitee