From 129f6b0d1814295da37024cfa589685f44060140 Mon Sep 17 00:00:00 2001 From: "OWNEROR-41FNVD0\\lenovo" Date: Thu, 15 May 2025 16:22:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/albumView/src/main/ets/views/AlbumView.ets | 8 ++++++++ features/pictureView/src/main/ets/view/CenterPart.ets | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/features/albumView/src/main/ets/views/AlbumView.ets b/features/albumView/src/main/ets/views/AlbumView.ets index 30fd4eb..84058d8 100644 --- a/features/albumView/src/main/ets/views/AlbumView.ets +++ b/features/albumView/src/main/ets/views/AlbumView.ets @@ -47,9 +47,11 @@ export struct AlbumView { timeOutDownDemo: number = 0 // Change the number of Grid columns based on the width of the Grid component. + // [Start get_grid_column] getGridColumn(value: Length): number { return Math.floor(2 * ((parseInt(JSON.stringify(value)) / 360) - 1) + 4); } + // [End get_grid_column] // PinchGesture up up() { @@ -157,7 +159,9 @@ export struct AlbumView { SideColumn() .width($r('app.float.side_width')) } + // [Start album_view_change] Flex({ direction: FlexDirection.Column }) { + // [StartExclude album_view_change_1] this.topRow() Flex() { Grid() { @@ -174,9 +178,11 @@ export struct AlbumView { .columnsTemplate(new Array(this.gridColumn).fill(DEFAULT_GRID_TEMPLATE).join(' ')) } + // [EndExclude album_view_change_1] .onAreaChange((oldValue: Area, newValue: Area) => { this.gridColumn = this.getGridColumn(newValue.width); }) + // [StartExclude album_view_change_2] .gesture(PinchGesture({ fingers: FINGER_NUMBER }).onActionUpdate((event: GestureEvent) => { if (event.scale > 1) { this.up() @@ -184,7 +190,9 @@ export struct AlbumView { this.down() } })) + // [EndExclude album_view_change_2] } + // [End album_view_change] } .padding({ top: deviceInfo.deviceType === BaseConstants.DEVICE_2IN1 ? $r('app.float.zero') : diff --git a/features/pictureView/src/main/ets/view/CenterPart.ets b/features/pictureView/src/main/ets/view/CenterPart.ets index 1f43091..b575c06 100755 --- a/features/pictureView/src/main/ets/view/CenterPart.ets +++ b/features/pictureView/src/main/ets/view/CenterPart.ets @@ -27,15 +27,18 @@ export struct CenterPart { build() { Flex({ direction: FlexDirection.Column }) { Blank() + // [Start center_part] Row() { Column() { Image($r('app.media.photo')) .autoResize(true) } } + // [StartExclude center_part] .height(Adaptive.PICTURE_HEIGHT(this.currentBp)) .width(Adaptive.PICTURE_WIDTH(this.currentBp)) .scale({ x: this.scaleValue, y: this.scaleValue, z: 1 }) + // [EndExclude center_part] .gesture(PinchGesture({ fingers: FINGER_NUM }) .onActionUpdate((event: GestureEvent | undefined) => { if (event) { @@ -45,7 +48,7 @@ export struct CenterPart { .onActionEnd(() => { this.pinchValue = this.scaleValue; })) - + // [End center_part] Blank() .height(this.currentBp === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.center_blank_height_lg') : 0) } -- Gitee