lxy 2 years ago
parent
commit
055c6e8a10

+ 15 - 6
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -1221,12 +1221,19 @@
         self.stitchView.hidden = YES;
 
         self.flashButton.hidden = NO;
-        self.panoramOrientationGuideView.hidden = NO;
-        self.panoramaGuideView.hidden = NO;
+
         self.modeList.hidden = NO;
         self.savePhotoButton.hidden = NO;
         self.takePhotoButton.hidden = NO;
-        self.ai_fullView.hidden = NO;
+        if (self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA) {
+            self.ai_fullView.hidden = YES;
+            self.panoramOrientationGuideView.hidden = YES;
+            self.panoramaGuideView.hidden = YES;
+        } else {
+            self.ai_fullView.hidden = NO;
+            self.panoramOrientationGuideView.hidden = NO;
+            self.panoramaGuideView.hidden = NO;
+        }
 //        self.switchButton.hidden = isSaveIng;
         self.discardPhotoButton.hidden = NO;
         self.backButton.hidden = YES;
@@ -1401,12 +1408,14 @@
 
 - (void)updatePreViewLayer {
     CGFloat width = [UIScreen mainScreen].bounds.size.width;
+    CGFloat height = [UIScreen mainScreen].bounds.size.height;
+
     switch (self.mode) {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
             self.switchButton.hidden = NO;
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
-            self.previewLayer.frame = CGRectMake(0, 0, width, width*4/3);
+            self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
         }
             
             break;
@@ -1414,7 +1423,7 @@
             self.switchButton.hidden = NO;
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
-            self.previewLayer.frame = CGRectMake(0, 0, width, width*4/3);
+            self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
         }
             
             break;
@@ -1437,7 +1446,7 @@
             break;
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA: {
             self.switchButton.hidden = YES;
-            self.panoramaGuideView.hidden = NO;
+            self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
             self.previewLayer.frame = self.view.layer.bounds;
         }

+ 18 - 1
SDK/LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m

@@ -252,8 +252,12 @@
 }
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
+//    [self scrollViewDidEndDecelerating:self.collectionView];
     [self.collectionView scrollToItemAtIndexPath:self.currentIndexPath atScrollPosition:UICollectionViewScrollPositionRight animated:NO];
     self.collectionView.hidden = NO;
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.35 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self updateCurrentIndexPath];
+    });
 }
 
 - (UIImageView *)lineImageView {
@@ -342,7 +346,15 @@
      self.currentIndexPath = currentIndexPath;
     [self changeLabelStatusWith:currentIndexPath.section + 1];
     [self updateCountLabelWith:currentIndexPath];
-    [self.collectionView reloadData];
+//    [self.collectionView reloadData];
+}
+
+- (void)updateCurrentIndexPath {
+    NSArray *indexPaths = [self.collectionView indexPathsForVisibleItems];
+    NSIndexPath *currentIndexPath = indexPaths.firstObject;
+    self.currentIndexPath = currentIndexPath;
+   [self changeLabelStatusWith:currentIndexPath.section + 1];
+   [self updateCountLabelWith:currentIndexPath];
 }
 
 - (void)updateViewWhenDelete {
@@ -630,10 +642,15 @@
                 }
             }
             [self setupModeView];
+            [self scrollViewDidEndDecelerating:self.collectionView];
+
 //            [self updateScrollWith:self.currentIndex];
             [self.collectionView reloadData];
             [self.view setNeedsLayout];
             [self.view layoutIfNeeded];
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.35 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                [self updateCurrentIndexPath];
+            });
             
 //            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [self updateViewWhenDelete];