Skip to content

Commit

Permalink
Merge branch 'master' of github.com:truckfly/react-native-signature-c…
Browse files Browse the repository at this point in the history
…apture

* 'master' of github.com:truckfly/react-native-signature-capture:
  Remove native buttons 2/2
  Remove native buttons 1/2
  • Loading branch information
aouaki committed Aug 28, 2017
2 parents de6f884 + c6e48a5 commit 86841d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
62 changes: 0 additions & 62 deletions ios/RSSignatureView.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation RSSignatureView {
UILabel *titleLabel;
BOOL _rotateClockwise;
BOOL _square;
BOOL _showNativeButtons;
BOOL _showTitleLabel;
}

Expand All @@ -25,7 +24,6 @@ @implementation RSSignatureView {

- (instancetype)init
{
_showNativeButtons = YES;
_showTitleLabel = YES;
if ((self = [super init])) {
_border = [CAShapeLayer layer];
Expand Down Expand Up @@ -79,34 +77,6 @@ - (void)layoutSubviews
//[titleLabel setBackgroundColor:[UIColor greenColor]];
[sign addSubview:titleLabel];
}

if (_showNativeButtons) {
//Save button
saveButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[saveButton setLineBreakMode:NSLineBreakByClipping];
[saveButton addTarget:self action:@selector(onSaveButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[saveButton setTitle:@"Save" forState:UIControlStateNormal];

CGSize buttonSize = CGSizeMake(80, 55.0);

saveButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width,
0, buttonSize.width, buttonSize.height);
[saveButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]];
[sign addSubview:saveButton];


//Clear button
clearButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[clearButton setLineBreakMode:NSLineBreakByClipping];
[clearButton addTarget:self action:@selector(onClearButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[clearButton setTitle:@"Reset" forState:UIControlStateNormal];

clearButton.frame = CGRectMake(0, 0, buttonSize.width, buttonSize.height);
[clearButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]];
[sign addSubview:clearButton];
}
}
else {

Expand All @@ -121,34 +91,6 @@ - (void)layoutSubviews
//[titleLabel setBackgroundColor:[UIColor greenColor]];
[sign addSubview:titleLabel];
}

if (_showNativeButtons) {
//Save button
saveButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[saveButton setTransform:CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90))];
[saveButton setLineBreakMode:NSLineBreakByClipping];
[saveButton addTarget:self action:@selector(onSaveButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[saveButton setTitle:@"Save" forState:UIControlStateNormal];

CGSize buttonSize = CGSizeMake(55, 80.0); //Width/Height is swapped

saveButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width, sign.bounds.size.height - buttonSize.height, buttonSize.width, buttonSize.height);
[saveButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]];
[sign addSubview:saveButton];

//Clear button
clearButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[clearButton setTransform:CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90))];
[clearButton setLineBreakMode:NSLineBreakByClipping];
[clearButton addTarget:self action:@selector(onClearButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[clearButton setTitle:@"Reset" forState:UIControlStateNormal];

clearButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width, 0, buttonSize.width, buttonSize.height);
[clearButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]];
[sign addSubview:clearButton];
}
}

}
Expand All @@ -165,10 +107,6 @@ - (void)setSquare:(BOOL)square {
_square = square;
}

- (void)setShowNativeButtons:(BOOL)showNativeButtons {
_showNativeButtons = showNativeButtons;
}

- (void)setShowTitleLabel:(BOOL)showTitleLabel {
_showTitleLabel = showTitleLabel;
}
Expand Down
1 change: 0 additions & 1 deletion ios/RSSignatureViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ @implementation RSSignatureViewManager

RCT_EXPORT_VIEW_PROPERTY(rotateClockwise, BOOL)
RCT_EXPORT_VIEW_PROPERTY(square, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showNativeButtons, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showTitleLabel, BOOL)


Expand Down

0 comments on commit 86841d6

Please sign in to comment.