|
@@ -473,23 +473,23 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
|
|
|
|
- (void)showImageWith:(UIImage * _Nullable)image {
|
|
- (void)showImageWith:(UIImage * _Nullable)image {
|
|
|
|
|
|
|
|
+// self.lastImage = image;
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
- CGFloat imageWH = 0;
|
|
|
|
- if (image) {
|
|
|
|
- if (self.currentDirection == PanoramaOrientationViewDown || self.currentDirection == PanoramaOrientationViewUp) {
|
|
|
|
- imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
- } else {
|
|
|
|
- imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ __block CGFloat imageWH = 0;
|
|
|
|
+ if (!image) {
|
|
self.offSetTop = @((120-38)/2);
|
|
self.offSetTop = @((120-38)/2);
|
|
self.offSetLeft = @((120-38)/2);
|
|
self.offSetLeft = @((120-38)/2);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ NSLog(@"1111111111111111111&&&&: %f", self.offSetTop.doubleValue);
|
|
|
|
|
|
self.showImageView.image = image;
|
|
self.showImageView.image = image;
|
|
[UIView animateWithDuration:.15 animations:^{
|
|
[UIView animateWithDuration:.15 animations:^{
|
|
- switch (self.currentDirection) {
|
|
|
|
- case PanoramaOrientationViewDown: {
|
|
|
|
|
|
+ if (self.dir == TgDirectionPortrait) {
|
|
|
|
+ if (self.orginDir == PanoramaOrientationViewDown) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
make.height.mas_equalTo(imageWH);
|
|
make.height.mas_equalTo(imageWH);
|
|
make.height.mas_lessThanOrEqualTo(self);
|
|
make.height.mas_lessThanOrEqualTo(self);
|
|
@@ -499,9 +499,10 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
make.bottom.mas_offset(-imageWH);
|
|
make.bottom.mas_offset(-imageWH);
|
|
make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
}];
|
|
}];
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case PanoramaOrientationViewUp:{
|
|
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewUp) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.right.top.mas_equalTo(0);
|
|
make.left.right.top.mas_equalTo(0);
|
|
make.height.mas_equalTo(imageWH);
|
|
make.height.mas_equalTo(imageWH);
|
|
@@ -512,10 +513,26 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
|
|
}];
|
|
}];
|
|
-
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case PanoramaOrientationViewRight: {
|
|
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewLeft) {
|
|
|
|
+
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.top.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.mas_offset(imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
make.width.mas_equalTo(imageWH);
|
|
make.width.mas_equalTo(imageWH);
|
|
make.width.mas_lessThanOrEqualTo(self);
|
|
make.width.mas_lessThanOrEqualTo(self);
|
|
@@ -528,9 +545,101 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
|
|
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
- break;
|
|
|
|
|
|
+
|
|
|
|
+ } else if (self.dir == TgDirectionLeft) {
|
|
|
|
+ if (self.orginDir == PanoramaOrientationViewLeft) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.right.top.mas_equalTo(0);
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.top.mas_offset(imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.bottom.mas_offset(-imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewUp) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.top.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.right.mas_offset(-imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewDown) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.top.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
|
|
- case PanoramaOrientationViewLeft:{
|
|
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.mas_offset(imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (self.dir == TgDirectionRight) {
|
|
|
|
+ if (self.orginDir == PanoramaOrientationViewLeft) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.bottom.mas_offset(-imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.right.top.mas_equalTo(0);
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.top.mas_offset(imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewUp) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
[self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
make.width.mas_equalTo(imageWH);
|
|
make.width.mas_equalTo(imageWH);
|
|
make.width.mas_lessThanOrEqualTo(self);
|
|
make.width.mas_lessThanOrEqualTo(self);
|
|
@@ -541,14 +650,86 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
make.left.mas_offset(imageWH);
|
|
make.left.mas_offset(imageWH);
|
|
make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewDown) {
|
|
|
|
+
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.top.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.right.mas_offset(-imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
|
|
+ } else if (self.dir == TgDirectionDown) {
|
|
|
|
+ if (self.orginDir == PanoramaOrientationViewLeft) {
|
|
|
|
+
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.top.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
|
|
- break;
|
|
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.right.mas_offset(-imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.width)/image.size.height;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.width.mas_equalTo(imageWH);
|
|
|
|
+ make.width.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.top.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.mas_offset(imageWH);
|
|
|
|
+ make.top.mas_equalTo(self.offSetTop.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewUp) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ make.left.right.bottom.mas_equalTo(0);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.bottom.mas_offset(-imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+ }];
|
|
|
|
+ } else if (self.orginDir == PanoramaOrientationViewDown) {
|
|
|
|
+ if (image) {
|
|
|
|
+ imageWH = (PanoramaGuideViewWOrH * image.size.height)/image.size.width;
|
|
|
|
+ }
|
|
|
|
+ [self.showImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.left.right.top.mas_equalTo(0);
|
|
|
|
+ make.height.mas_equalTo(imageWH);
|
|
|
|
+ make.height.mas_lessThanOrEqualTo(self);
|
|
|
|
+ }];
|
|
|
|
+ [self.whiteArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
+ make.top.mas_offset(imageWH);
|
|
|
|
+ make.left.mas_equalTo(self.offSetLeft.doubleValue);
|
|
|
|
+
|
|
|
|
+ }];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
[self setNeedsLayout];
|
|
[self setNeedsLayout];
|
|
[self layoutIfNeeded];
|
|
[self layoutIfNeeded];
|
|
}];
|
|
}];
|
|
@@ -565,25 +746,47 @@ CGFloat const PanoramaGuideViewWOrH = 120;
|
|
if (!self.showImageView.image) {
|
|
if (!self.showImageView.image) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
|
|
|
|
- if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
- self.offSetLeft = @((120-38)/2);
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirLeft) {
|
|
|
|
- self.offSetLeft = @(0);
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirRight) {
|
|
|
|
- self.offSetLeft = @(120-38);
|
|
|
|
|
|
+ if (self.dir == TgDirectionPortrait || self.dir == TgDirectionDown) {
|
|
|
|
+ if (dir == PanoramaOrientationViewDown || dir == PanoramaOrientationViewUp) {
|
|
|
|
+ if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+ self.offSetLeft = @((120-38)/2);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirLeft) {
|
|
|
|
+ self.offSetLeft = @(0);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirRight) {
|
|
|
|
+ self.offSetLeft = @(120-38);
|
|
|
|
+ }
|
|
|
|
+ } else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+ self.offSetTop = @((120-38)/2);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirUp) {
|
|
|
|
+ self.offSetTop = @(0);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirDown) {
|
|
|
|
+ self.offSetTop = @(120-38);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
|
|
|
|
- if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
- self.offSetTop = @((120-38)/2);
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirUp) {
|
|
|
|
- self.offSetTop = @(0);
|
|
|
|
- } else if (arrowDir == PanoramaArrowDirDown) {
|
|
|
|
- self.offSetTop = @(120-38);
|
|
|
|
|
|
+ } else if (self.dir == TgDirectionLeft || self.dir == TgDirectionRight) {
|
|
|
|
+ if (dir == PanoramaOrientationViewLeft || dir == PanoramaOrientationViewRight) {
|
|
|
|
+ if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+ self.offSetLeft = @((120-38)/2);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirLeft) {
|
|
|
|
+ self.offSetLeft = @(0);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirRight) {
|
|
|
|
+ self.offSetLeft = @(120-38);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (arrowDir == PanoramaArrowDirCenter) {
|
|
|
|
+ self.offSetTop = @((120-38)/2);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirUp) {
|
|
|
|
+ self.offSetTop = @(0);
|
|
|
|
+ } else if (arrowDir == PanoramaArrowDirDown) {
|
|
|
|
+ self.offSetTop = @(120-38);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ [self showImageWith:self.showImageView.image];
|
|
|
|
+
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|