cjb hace 1 semana
padre
commit
c6321da175

+ 1 - 0
entry/src/main/ets/pages/CameraView.ets

@@ -578,6 +578,7 @@ export struct CameraDialog {
 
   private adjustOffsetWithAnimation() {
     const isRotated = (this.rotateAngle === 90 || this.rotateAngle === 270);
+    //旋转90度或者70度  宽度0.667倍,长度超过1.5倍才拖动
     let moveScaleY = (this.scaleValue - (isRotated ? 0.667 : 1)) / 2;
     let moveScaleX = (this.scaleValue - (isRotated ? 1.50 : 1)) / 2;
     let maxOffsetX = (this.scaleValue<1.5&&isRotated) ?this.offsetX: (isRotated ? 506 : 760) * moveScaleX;

+ 20 - 0
entry/src/main/ets/pages/ProcessIndex.ets

@@ -1037,6 +1037,16 @@ struct ProcessIndex {
         .height('100%')
         .width('100%')
         .justifyContent(FlexAlign.End)
+        //向下滑动关闭抽屉
+        .gesture(
+          GestureGroup(
+            GestureMode.Sequence,
+            PanGesture({ direction: PanDirection.Down })
+              .onActionStart(() => {
+                this.isAuxiliaryViewOpen = false
+              })
+          )
+        )
         .transition(
           TransitionEffect.OPACITY
             .combine(TransitionEffect.translate({ y: 1000 }))
@@ -1051,6 +1061,16 @@ struct ProcessIndex {
     }
     .height('100%')
     .width('100%')
+    //向上滑动打开抽屉
+    .gesture(
+      GestureGroup(
+        GestureMode.Sequence,
+        PanGesture({ direction: PanDirection.Up })
+          .onActionStart(() => {
+           this.isAuxiliaryViewOpen = true
+          })
+      )
+    )
   }
 
   @Builder

+ 0 - 22
entry/src/main/ets/view/process/MultiMediaCollect.ets

@@ -393,28 +393,6 @@ export struct MultiMediaCollect {
     }
   }
 
-  // private adjustOffsetWithAnimation() {
-  //   let moveScale = (this.scaleValue-1)/2
-  //   // const maxOffsetX =  760*moveScale  //rk3588
-  //   // const maxOffsetY =  520*moveScale  //rk3588
-  //   const maxOffsetX =  1635/1.5*moveScale  //rk3568
-  //   const maxOffsetY =  1038/1.5*moveScale  //rk3568
-  //   // 钳制偏移量到合法范围内
-  //   const clampedX = Math.max(-maxOffsetX, Math.min(maxOffsetX, this.offsetX));
-  //   const clampedY = Math.max(-maxOffsetY, Math.min(maxOffsetY, this.offsetY));
-  //
-  //   // 只有超出边界时才触发动画
-  //   if (this.offsetX !== clampedX || this.offsetY !== clampedY) {
-  //     animateTo({
-  //       duration: 300,
-  //       curve: Curve.EaseOut
-  //     }, () => {
-  //       this.offsetX = clampedX;
-  //       this.offsetY = clampedY;
-  //     });
-  //   }
-  // }
-
   async aboutToAppear() {
     this.loadPhotos();
     await this.createSubscriber();