-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
node_modules/**/* | ||
.expo/* | ||
npm-debug.* | ||
*.jks | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
web-report/ | ||
.npmrc | ||
yarn-error.log | ||
.idea/ | ||
coverage/ | ||
.vscode/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, {Component} from 'react'; | ||
import {Button, StyleSheet, Text, View} from 'react-native'; | ||
|
||
import Voice from 'react-native-voice'; | ||
|
||
|
||
export default class App extends Component{ | ||
state = { | ||
listening: "pause", | ||
complete: '', | ||
partial: '', | ||
}; | ||
constructor(props) { | ||
super(props); | ||
Voice.onSpeechStart = this.onSpeechStartHandler.bind(this); | ||
Voice.onSpeechEnd = this.onSpeechEndHandler.bind(this); | ||
Voice.onSpeechError = this.onSpeechError.bind(this); | ||
Voice.onSpeechResults = this.onSpeechResultsHandler.bind(this); | ||
Voice.onSpeechPartialResults = this.onSpeechPartialHandler.bind(this); | ||
} | ||
|
||
onSpeechResultsHandler(result){ | ||
console.log("result start", result) | ||
this.setState({complete: result.value}) | ||
} | ||
|
||
onSpeechPartialHandler(result){ | ||
console.log("result partial", result) | ||
this.setState({partial: result.value}) | ||
} | ||
|
||
onSpeechStartHandler(){ | ||
this.setState({listening:"started"}) | ||
console.log("speech started") | ||
} | ||
|
||
onSpeechEndHandler(result){ | ||
console.log("result stop", result) | ||
this.setState({listening:"pause"}) | ||
} | ||
onSpeechError(err){ | ||
console.log(err) | ||
} | ||
|
||
render() { | ||
return ( | ||
<View> | ||
<Text>Prova2</Text> | ||
<Text>react-native-voice Test</Text> | ||
<Button title={'start'} onPress={(e) => { | ||
console.log("start") | ||
Voice.onSpeechStart = this.onSpeechStartHandler.bind(this); | ||
Voice.start("it-IT"); | ||
}}/> | ||
<Text>Ascolto {this.state.listening}</Text> | ||
<Text>Che cosa hai detto? {this.state.complete}</Text> | ||
<Text>Partial {this.state.partial}</Text> | ||
</View> | ||
) | ||
}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
|
||
export default function App() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text>Open up App.tsx to start working on your app!</Text> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Thu Aug 29 15:00:01 CEST 2019 | ||
gradle.version=4.10.1 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.