|
@@ -14,6 +14,7 @@
|
|
|
#import "CPDFShareCircleViewController_Header.h"
|
|
|
#import "CPDFArrowStyleView.h"
|
|
|
#import "CShapeSelectView.h"
|
|
|
+#import "CPDFDrawArrowView.h"
|
|
|
|
|
|
#import <compdfkit_tools/CPDFColorUtils.h>
|
|
|
|
|
@@ -54,6 +55,10 @@
|
|
|
self.arrowLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
[self.scrcollView addSubview:self.arrowLabel];
|
|
|
|
|
|
+
|
|
|
+ CPDFDrawArrowView *arrView = [[CPDFDrawArrowView alloc] initWithFrame:CGRectMake(0, 0, 80, 30)];
|
|
|
+
|
|
|
+
|
|
|
self.arrowBtn = [[UIButton alloc] init];
|
|
|
[self.arrowBtn setImage:[UIImage imageNamed:@"CPDFShapeArrowImageStart" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
self.arrowBtn.layer.borderWidth = 1.0;
|
|
@@ -77,6 +82,8 @@
|
|
|
self.trialBtn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
|
|
|
[self.scrcollView addSubview:self.trialBtn];
|
|
|
|
|
|
+ self.fillColorSelectView.hidden = YES;
|
|
|
+
|
|
|
self.view.backgroundColor = [CPDFColorUtils CAnnotationPropertyViewControllerBackgoundColor];
|
|
|
}
|
|
|
|
|
@@ -86,25 +93,43 @@
|
|
|
self.scrcollView.contentSize = CGSizeMake(self.view.frame.size.width, 500);
|
|
|
|
|
|
if (@available(iOS 11.0, *)) {
|
|
|
- self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, 180, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
- self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, 270, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
+ CGFloat offsetY = 0;
|
|
|
self.colorView.frame = CGRectMake(self.view.safeAreaInsets.left, 0,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
- self.fillColorSelectView.frame = CGRectMake(self.view.safeAreaInsets.left, 90,self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
- self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, 360, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
- self.arrowLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 450, 100, 45);
|
|
|
- self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100 - self.view.safeAreaInsets.right, 457.5, 80, 30);
|
|
|
- self.trialLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, 495, 100, 45);
|
|
|
- self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100- self.view.safeAreaInsets.right, 502.5, 80, 30);
|
|
|
+ offsetY+= self.colorView.frame.size.height;
|
|
|
+ self.opacitySliderView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
+ offsetY+= self.opacitySliderView.frame.size.height;
|
|
|
+
|
|
|
+ self.thicknessView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
+ offsetY+= self.thicknessView.frame.size.height;
|
|
|
+
|
|
|
+ self.dottedView.frame = CGRectMake(self.view.safeAreaInsets.left, offsetY, self.view.frame.size.width - self.view.safeAreaInsets.left - self.view.safeAreaInsets.right, 90);
|
|
|
+ offsetY+= self.dottedView.frame.size.height;
|
|
|
+
|
|
|
+ self.arrowLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
|
|
|
+ self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100 - self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
|
|
|
+ offsetY+= self.arrowLabel.frame.size.height;
|
|
|
+
|
|
|
+ self.trialLabel.frame = CGRectMake(self.view.safeAreaInsets.left+20, offsetY, 100, 45);
|
|
|
+ self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100- self.view.safeAreaInsets.right, offsetY + 7.5, 80, 30);
|
|
|
} else {
|
|
|
- self.opacitySliderView.frame = CGRectMake(10, 180, self.view.frame.size.width - 20, 90);
|
|
|
- self.thicknessView.frame = CGRectMake(10, 270, self.view.frame.size.width - 20, 90);
|
|
|
- self.dottedView.frame = CGRectMake(10, 360, self.view.frame.size.width - 20, 90);
|
|
|
- self.fillColorSelectView.frame = CGRectMake(10, 210,self.view.frame.size.width - 20, 90);
|
|
|
- self.colorView.frame = CGRectMake(10, 0,self.view.frame.size.width, 90);
|
|
|
- self.arrowLabel.frame = CGRectMake(15, 450, 60, 45);
|
|
|
- self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 75, 457.5, 60, 45);
|
|
|
- self.trialLabel.frame = CGRectMake(15, 495, 60, 45);
|
|
|
- self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 75, 502.5, 60, 45);
|
|
|
+ CGFloat offsetY = 0;
|
|
|
+ self.colorView.frame = CGRectMake(0, 0,self.view.frame.size.width, 90);
|
|
|
+ offsetY+= self.colorView.frame.size.height;
|
|
|
+ self.opacitySliderView.frame = CGRectMake(0, offsetY, self.view.frame.size.width - 0, 90);
|
|
|
+ offsetY+= self.opacitySliderView.frame.size.height;
|
|
|
+
|
|
|
+ self.thicknessView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
|
|
|
+ offsetY+= self.thicknessView.frame.size.height;
|
|
|
+
|
|
|
+ self.dottedView.frame = CGRectMake(0, offsetY, self.view.frame.size.width, 90);
|
|
|
+ offsetY+= self.dottedView.frame.size.height;
|
|
|
+
|
|
|
+ self.arrowLabel.frame = CGRectMake(20, offsetY, 100, 45);
|
|
|
+ self.arrowBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
|
|
|
+ offsetY+= self.arrowLabel.frame.size.height;
|
|
|
+
|
|
|
+ self.trialLabel.frame = CGRectMake(20, offsetY, 100, 45);
|
|
|
+ self.trialBtn.frame = CGRectMake(self.view.frame.size.width - 100, offsetY + 7.5, 80, 30);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -129,25 +154,32 @@
|
|
|
}
|
|
|
|
|
|
- (void)updatePreferredContentSizeWithTraitCollection:(UITraitCollection *)traitCollection {
|
|
|
- self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 750);
|
|
|
+ if([self.startArrowStyleView superview] || [self.endArrowStyleView superview]) {
|
|
|
+ self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 120);
|
|
|
+ } else {
|
|
|
+ self.preferredContentSize = CGSizeMake(self.view.bounds.size.width, traitCollection.verticalSizeClass == UIUserInterfaceSizeClassCompact ? 350 : 660);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#pragma mark - Action
|
|
|
|
|
|
- (void)buttonItemClicked_start:(id)sender {
|
|
|
- self.startArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrow Style"];
|
|
|
+ self.startArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrow Style",nil)];
|
|
|
self.startArrowStyleView.frame = self.view.frame;
|
|
|
self.startArrowStyleView.delegate = self;
|
|
|
self.startArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
|
[self.view addSubview:self.startArrowStyleView];
|
|
|
+ [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
|
|
|
}
|
|
|
|
|
|
- (void)buttonItemClicked_trial:(id)sender {
|
|
|
- self.endArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:@"Arrowtail style"];
|
|
|
+ self.endArrowStyleView = [[CPDFArrowStyleView alloc] initWirhTitle:NSLocalizedString(@"Arrowtail style",nil)];
|
|
|
self.endArrowStyleView.frame = self.view.frame;
|
|
|
self.endArrowStyleView.delegate = self;
|
|
|
self.endArrowStyleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
|
[self.view addSubview:self.endArrowStyleView];
|
|
|
+ [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
|
|
|
}
|
|
|
|
|
|
#pragma mark - CPDFArrowStyleViewDelegate
|
|
@@ -170,6 +202,10 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)arrowStyleRemoveView:(CPDFArrowStyleView *)arrowStyleView {
|
|
|
+ [self updatePreferredContentSizeWithTraitCollection:self.traitCollection];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - CPDFOpacitySliderViewDelegate
|
|
|
|
|
|
- (void)opacitySliderView:(CPDFOpacitySliderView *)opacitySliderView opacity:(CGFloat)opacity {
|