Skip to content

Commit

Permalink
allow to hide the dashed border (on iOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harald Reingruber committed May 16, 2017
1 parent 2e1bc16 commit f1f529a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class CustomComponent extends Component {
+ **saveImageFileInExtStorage** : Make this props true, if you want to save the image file in external storage. Default is false. Warning: Image file will be visible in gallery or any other image browsing app
+ **showBorder** : If this props is made to false, it will hide the dashed border (the border is shown on iOS only).
+ **showNativeButtons** : If this props is made to true, it will display the native buttons "Save" and "Reset".
+ **showTitleLabel** : If this props is made to true, it will display the "x_ _ _ _ _ _ _ _ _ _ _" placeholder indicating where to sign.
Expand Down
1 change: 1 addition & 0 deletions SignatureCapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ SignatureCapture.propTypes = {
square: PropTypes.bool,
saveImageFileInExtStorage: PropTypes.bool,
viewMode: PropTypes.string,
showBorder: PropTypes.bool,
showNativeButtons: PropTypes.bool,
showTitleLabel: PropTypes.bool,
maxSize:PropTypes.number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class RSSignatureCaptureMainView extends LinearLayout implements OnClickL
int mOriginalOrientation;
Boolean saveFileInExtStorage = false;
String viewMode = "portrait";
Boolean showBorder = true;
Boolean showNativeButtons = true;
Boolean showTitleLabel = true;
int maxSize = 500;
Expand Down
8 changes: 7 additions & 1 deletion ios/RSSignatureView.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ @implementation RSSignatureView {
UILabel *titleLabel;
BOOL _rotateClockwise;
BOOL _square;
BOOL _showBorder;
BOOL _showNativeButtons;
BOOL _showTitleLabel;
}
Expand All @@ -25,6 +26,7 @@ @implementation RSSignatureView {

- (instancetype)init
{
_showBorder = YES;
_showNativeButtons = YES;
_showTitleLabel = YES;
if ((self = [super init])) {
Expand Down Expand Up @@ -153,7 +155,7 @@ - (void)layoutSubviews

}
_loaded = true;
_border.path = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
_border.path = _showBorder ? [UIBezierPath bezierPathWithRect:self.bounds].CGPath : nil;
_border.frame = self.bounds;
}

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

- (void)setShowBorder:(BOOL)showBorder {
_showBorder = showBorder;
}

- (void)setShowNativeButtons:(BOOL)showNativeButtons {
_showNativeButtons = showNativeButtons;
}
Expand Down
1 change: 1 addition & 0 deletions ios/RSSignatureViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ @implementation RSSignatureViewManager

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

Expand Down

0 comments on commit f1f529a

Please sign in to comment.