From 7f05ea6a356efc9315d624303d48ba0881180f4b Mon Sep 17 00:00:00 2001 From: wpp <58198665+879356503@users.noreply.github.com> Date: Tue, 27 May 2025 22:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E4=B8=AD=E7=94=BB=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81PC=EF=BC=8C=E6=B7=BB=E5=8A=A0toast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/entryability/EntryAbility.ets | 4 ++- entry/src/main/ets/pages/VideoPlay.ets | 25 +++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 0d332c6..10d8502 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -31,8 +31,10 @@ export default class EntryAbility extends UIAbility { newBp = 'sm'; } else if (windowWidthVp < 840) { newBp = 'md'; - } else { + } else if (windowWidthVp < 1440) { newBp = 'lg'; + } else { + newBp = 'xl'; } if (this.curBp !== newBp) { this.curBp = newBp; diff --git a/entry/src/main/ets/pages/VideoPlay.ets b/entry/src/main/ets/pages/VideoPlay.ets index ea461d1..4558d95 100644 --- a/entry/src/main/ets/pages/VideoPlay.ets +++ b/entry/src/main/ets/pages/VideoPlay.ets @@ -194,6 +194,19 @@ export struct PlayVideo { Logger.info(`[${TAG}] onActionEvent: ${this.buttonAction} status:${status}}`); } + showToast() { + if (this.curBp === 'xl') { + try { + promptAction.showToast(({ + message: $r('app.string.notsupport'), + duration: 2000 + })); + } catch (error) { + Logger.error(`showToast args error code is ${error.code}, message is ${error.message}}`); + } + } + } + @Builder AutoPip() { Row() { @@ -205,6 +218,7 @@ export struct PlayVideo { .height($r('app.integer.auto_button_height')) .selectedColor($r('sys.color.brand')) .onChange(async (isOn: boolean) => { + this.showToast(); this.isAutoPull = isOn; if (!this.pipController) { await this.createPipController(); @@ -417,16 +431,7 @@ export struct PlayVideo { this.startPip(); this.hintMsgVisibility = true; } - if (deviceInfo.productSeries === 'HYM' || deviceInfo.productSeries === 'HAD') { - try { - promptAction.showToast(({ - message: $r('app.string.notsupport'), - duration: 2000 - })); - } catch (error) { - Logger.error(`showToast args error code is ${error.code}, message is ${error.message}}`); - } - } + this.showToast(); }) } } -- Gitee