Open agrass opened 7 years ago
+1
+1
+1
👍
+1
Hi here! I've found a "partial solution".
If you go to this directory:
./node_modules/react-native-signature-capture/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureView.java
you will see the next two properties:
These are the two stroke width properties. You can change it and relaunch the project.
A notation: if you download the project and you install "node_modules", the width properties will change to the default value. You can avoid this doing a "postinstall" command in "package.json" and running a script that changes these values. Here my solution:
- package.json:
"postinstall": "cd scripts && node signatureStrokeWidth"
- scripts / signatureStrokeWidth.js:
const fs = require('fs'); `
fs.readFile(__dirname + '/../node_modules/react-native-signature-capture/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureView.java', 'utf8', function (err, data) {
if (err) {
return console.error(err);
}
let result = data.replace('mMinWidth = convertDpToPx(8);', 'mMinWidth = convertDpToPx(4);');
result = result.replace('mMaxWidth = convertDpToPx(16);', 'mMaxWidth = convertDpToPx(8);');
fs.writeFile(__dirname + '/../node_modules/react-native-signature-capture/android/src/main/java/com/rssignaturecapture/RSSignatureCaptureView.java', result, 'utf8', function (err) { if (err) return console.error(err); }); });
Hi @Drustus, Thanks! do you already do the change in IOS also? I'm going to work in my own fork as temporal solution and change this fixed values
Here is my fork if someone want less stoke width in Android:
npm i --save https://github.com/agrass/react-native-signature-capture
Hi @agrass, sorry, but I'm not working with IOS at the moment, so I haven't done this change on IOS.
I added this feature for Android on a forked repo : https://github.com/EllipApp/react-native-signature-capture
You can use the props minStrokeWidth={100}
and maxStrokeWidth={150}
(Those are sample values !)
@Thomeuxe could you make a PR to this repo? It would be great to get your feature merged into this npm package.
+1.
This would be a VERY good feature!
@Thomeuxe is it work on iOS ?
I added this feature for Android on a forked repo : https://github.com/EllipApp/react-native-signature-capture
You can use the props
minStrokeWidth={100}
andmaxStrokeWidth={150}
(Those are sample values !)
This didn't work for me. Can you please elaborate more?
here you my fork for both Android and IOS. npm i --save https://github.com/jughoor/react-native-signature-capture.git react-native link https://github.com/jughoor/react-native-signature-capture.git
I take the liberty of restarting this thread, because it is always an issue. I've fixed this in this fork https://www.npmjs.com/package/@lagregance/react-native-signature-capture
Hi!
There is a prop to change the stroke width??
Thanks!
Antonio