You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want here to update and simplify Android install and code : I use last 0.72.6 React Native
install:
just yarn add react-native-signature-capture
usage example:
import React, {useRef} from 'react';
const EcranSignature = () => {
const signRef = useRef(null);
saveSign = () => {
signRef.current.saveImage();
//then reset
resetSign();
};
resetSign = () => {
signRef.current.resetImage();
console.log('image reseted');
};
onSaveEvent = result => {
//result.encoded - for the base64 encoded png
//result.pathName - for the file path name
console.log('signature:', result);
};
onDragEvent = () => {
// This callback will be called when the user enters signature
console.log('dragged');
};
return (
<SafeAreaView style={{flex: 1, flexDirection: 'column'}}>
<Text style={{alignItems: 'center', justifyContent: 'center'}}>
signature reception
</Text>
<SignatureCapture
style={[{flex:1},styles.signature]}
ref={signRef}
onSaveEvent={onSaveEvent}
onDragEvent={onDragEvent}
saveImageFileInExtStorage={false}
showNativeButtons={false}
showTitleLabel={false}
backgroundColor="#ff00ff"
strokeColor="#ffffff"
minStrokeWidth={4}
maxStrokeWidth={4}
viewMode={'portrait'}
/>
<View style={{flex: 1, flexDirection: 'row'}}>
<TouchableOpacity
style={styles.buttonStyle}
onPress={() => {
saveSign();
}}>
<Text>Save</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.buttonStyle}
onPress={() => {
resetSign();
}}>
<Text>Reset</Text>
</TouchableOpacity>
</View>
</SafeAreaView>
);
};
then use this component as
The text was updated successfully, but these errors were encountered:
Productivix
changed the title
documentation simplifcation for Android install and use
documentation simplification for Android install and use
Nov 14, 2023
I just want here to update and simplify Android install and code : I use last 0.72.6 React Native
install:
just
yarn add react-native-signature-capture
usage example:
then use this component as
The text was updated successfully, but these errors were encountered: