From 67d469616fd0d017361967f490001c184caf6069 Mon Sep 17 00:00:00 2001 From: lon9 <815882449@qq.com> Date: Thu, 29 May 2025 20:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/entryability/EntryAbility.ets | 1 + entry/src/main/ets/views/CommonView.ets | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 1a1855e..76d975f 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -45,6 +45,7 @@ export default class EntryAbility extends UIAbility { // [EndExclude WindowSizeChange] let isFront: boolean | undefined = AppStorage.get('isFront'); let surfaceId: string | undefined = AppStorage.get('surfaceId'); + // In the trifold M state, select the back camera. if (widthBp === WidthBreakpoint.WIDTH_MD && heightBp === HeightBreakpoint.HEIGHT_MD && deviceInfo.productSeries === 'GRL') { this.cameraUtil?.cameraShooting(surfaceId!, this.context!, camera.CameraPosition.CAMERA_POSITION_BACK); diff --git a/entry/src/main/ets/views/CommonView.ets b/entry/src/main/ets/views/CommonView.ets index a6fc0a0..a03865c 100644 --- a/entry/src/main/ets/views/CommonView.ets +++ b/entry/src/main/ets/views/CommonView.ets @@ -51,17 +51,22 @@ export struct SettingButton { build() { Column() { Image(this.imageButton) - .height(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 48 : 30), 48, 48).getValue(this.widthBp)) - .width(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 48 : 30), 48, 48).getValue(this.widthBp)) + .height(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 48 : 30), 48, + 48).getValue(this.widthBp)) + .width(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 48 : 30), 48, + 48).getValue(this.widthBp)) .margin({ bottom: 2 }) Text(this.text) - .lineHeight(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 16 : 14), 16, 16).getValue(this.widthBp)) - .fontSize(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 12 : 10), 12, 12).getValue(this.widthBp)) + .lineHeight(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 16 : 14), 16, + 16).getValue(this.widthBp)) + .fontSize(new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 12 : 10), 12, + 12).getValue(this.widthBp)) .fontColor(Color.White) } .width(40) .margin({ - bottom: new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 16 : 8), 16, 16).getValue(this.widthBp)}) + bottom: new BreakpointType((this.heightBp === HeightBreakpoint.HEIGHT_LG ? 16 : 8), 16, 16).getValue(this.widthBp) + }) } } @@ -133,7 +138,8 @@ export struct ShotAreaSm { .onClick(() => { let isFront: boolean | undefined = AppStorage.get('isFront'); if (isFront) { - this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, camera.CameraPosition.CAMERA_POSITION_BACK); + this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, + camera.CameraPosition.CAMERA_POSITION_BACK); return; } this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, camera.CameraPosition.CAMERA_POSITION_FRONT); @@ -167,7 +173,8 @@ export struct ShotArea { .onClick(() => { let isFront: boolean | undefined = AppStorage.get('isFront'); if (isFront) { - this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, camera.CameraPosition.CAMERA_POSITION_BACK); + this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, + camera.CameraPosition.CAMERA_POSITION_BACK); return; } this.cameraUtil?.cameraShooting(this.surfaceId, this.context!, camera.CameraPosition.CAMERA_POSITION_FRONT); -- Gitee