diff --git a/README.md b/README.md index e632be23..92e7c5b3 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/SignatureCapture.js b/SignatureCapture.js index 9e72093c..5f804d28 100644 --- a/SignatureCapture.js +++ b/SignatureCapture.js @@ -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 diff --git a/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureMainView.java b/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureMainView.java index a8d77303..ec5bccd4 100644 --- a/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureMainView.java +++ b/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureMainView.java @@ -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; diff --git a/ios/RSSignatureView.m b/ios/RSSignatureView.m index ea437347..1c63ab99 100644 --- a/ios/RSSignatureView.m +++ b/ios/RSSignatureView.m @@ -16,6 +16,7 @@ @implementation RSSignatureView { UILabel *titleLabel; BOOL _rotateClockwise; BOOL _square; + BOOL _showBorder; BOOL _showNativeButtons; BOOL _showTitleLabel; } @@ -25,6 +26,7 @@ @implementation RSSignatureView { - (instancetype)init { + _showBorder = YES; _showNativeButtons = YES; _showTitleLabel = YES; if ((self = [super init])) { @@ -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; } @@ -165,6 +167,10 @@ - (void)setSquare:(BOOL)square { _square = square; } +- (void)setShowBorder:(BOOL)showBorder { + _showBorder = showBorder; +} + - (void)setShowNativeButtons:(BOOL)showNativeButtons { _showNativeButtons = showNativeButtons; } diff --git a/ios/RSSignatureViewManager.m b/ios/RSSignatureViewManager.m index 1ba6cb8f..e777880d 100644 --- a/ios/RSSignatureViewManager.m +++ b/ios/RSSignatureViewManager.m @@ -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)