From 5b5610d2844cad1b986828022c26aee08988f663 Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 16 Jun 2025 18:33:04 +0800 Subject: [PATCH] =?UTF-8?q?UX=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 7 ++++++- entry/src/main/ets/view/TrafficInfoView.ets | 13 +++++++++++++ entry/src/main/resources/base/element/string.json | 6 +++++- entry/src/main/resources/en_US/element/string.json | 4 ++++ entry/src/main/resources/zh_CN/element/string.json | 6 +++++- 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index de0d46f..1e0e6ca 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -39,11 +39,16 @@ struct TipDialog { .justifyContent(FlexAlign.Center) .alignItems(VerticalAlign.Center) + Blank() + Text($r('app.string.tip_text')) .fontSize(16) .fontWeight(FontWeight.Medium) .lineHeight(21) .fontColor($r('app.color.tip')) + .margin({ left: 16, right: 16 }) + + Blank() Row() { Text($r('app.string.tip_get')) @@ -88,7 +93,7 @@ export struct LiveViewLockScreenPage { autoCancel: true, cornerRadius: 32, width: 338, - height: 141 + height: 175, }); aboutToAppear(): void { diff --git a/entry/src/main/ets/view/TrafficInfoView.ets b/entry/src/main/ets/view/TrafficInfoView.ets index f874b06..6cccda4 100644 --- a/entry/src/main/ets/view/TrafficInfoView.ets +++ b/entry/src/main/ets/view/TrafficInfoView.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +import { promptAction } from '@kit.ArkUI'; import { LiveView } from '../utils/LiveView' @Component @@ -78,6 +79,12 @@ export struct TrafficInfoView { .onClick(() => { this.isShowButton = false; LiveView.getInstance().createLiveView(); + this.getUIContext().getPromptAction().showToast({ + message: $r('app.string.toast'), + duration: 2000, + showMode: promptAction.ToastShowMode.DEFAULT, + bottom: 180 + }); }) Blank() Button($r('app.string.Finish')) @@ -88,6 +95,12 @@ export struct TrafficInfoView { .onClick(() => { this.isShowButton = false; LiveView.getInstance().finishLiveView(); + this.getUIContext().getPromptAction().showToast({ + message: $r('app.string.toast'), + duration: 2000, + showMode: promptAction.ToastShowMode.DEFAULT, + bottom: 180 + }); }) Blank() } diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 46b8d3a..aa9d46c 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -86,11 +86,15 @@ }, { "name": "tip_text", - "value": "申请锁屏沉浸实况窗权限可完整体验该功能" + "value": " 本案例已完成Pura X内外屏适配和实况窗功能开发,因涉及权限申请,仅做UI展示,具体开发请参考示例代码。" }, { "name": "tip_get", "value": "知道了" + }, + { + "name": "toast", + "value": "仅做功能原型展示,具体业务需自行实现。" } ] } \ 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 a12041f..4d1556f 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -91,6 +91,10 @@ { "name": "tip_get", "value": "I get" + }, + { + "name": "toast", + "value": "Just a functional prototype—you’ll need to implement the business logic yourself." } ] } \ 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 46b8d3a..aa9d46c 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -86,11 +86,15 @@ }, { "name": "tip_text", - "value": "申请锁屏沉浸实况窗权限可完整体验该功能" + "value": " 本案例已完成Pura X内外屏适配和实况窗功能开发,因涉及权限申请,仅做UI展示,具体开发请参考示例代码。" }, { "name": "tip_get", "value": "知道了" + }, + { + "name": "toast", + "value": "仅做功能原型展示,具体业务需自行实现。" } ] } \ No newline at end of file -- Gitee