diff --git a/features/albumView/src/main/ets/views/AlbumView.ets b/features/albumView/src/main/ets/views/AlbumView.ets index 30fd4eb7f940588c88ca194a442833fad707533c..84058d834aec2defb5b8aa320814e3c5ea0596e6 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 1f430914e44bc6d7bb0261679e1f7430bf70baf8..b575c06bdf7092d8881132b643e3c94b3be8b9ce 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) }