Commit 30aa22bc authored by norhalimah's avatar norhalimah

updating ...

parent d9d76629
......@@ -15,6 +15,7 @@ import {
Dimensions,
BackHandler,
ScrollView,
Image,
} from 'react-native';
import styles from '../style/styleListen';
import {Stopwatch} from 'react-native-stopwatch-timer';
......@@ -62,7 +63,7 @@ const wroSound = require('../media/sound/wrong.mp3');
const keySound = Listennotes;
var soundN = '';
var indexS = 0;
//var indexS = 0;
var stime = 0;
//var records = [];
......@@ -84,6 +85,7 @@ class Listen extends React.Component {
showW : false,
showDone : false,
showQuit : false,
showMusic : false,
maxCount : 5,
records: [],
};
......@@ -177,7 +179,7 @@ class Listen extends React.Component {
console.log('play');
console.log(soundN);
console.log(Listennotes[soundN]);
//this.setState({name : Listennotes[soundN].name});
this.setState({showMusic: true});
var playSound = new Sound(keySound[soundN].url, (error) => {
if (error) {
console.log('failed to load the sound', error);
......@@ -187,6 +189,7 @@ class Listen extends React.Component {
playSound.play((success) => {
if (success) {
// console.log('successfully finished playing');
this.setState({showMusic: false});
} else {
// console.log('playback failed due to audio decoding errors');
playSound.release();
......@@ -279,7 +282,7 @@ class Listen extends React.Component {
this.setState({
maxCount : ccc,
});
indexS = Listennotes.findIndex(item=> item.name === this.state.name);
//indexS = Listennotes.findIndex(item=> item.name === this.state.name);
// console.log(this.state.name);
})
.catch((err) => {
......@@ -325,6 +328,18 @@ class Listen extends React.Component {
source={require('../media/img/background.jpg')}
style={styles.imagebackground}>
{/* Play Sound */}
<Modal transparent={true} visible={this.state.showMusic} animationType="slide">
<View style={styles.modalbackground}>
<View style={{alignItems:'center', alignContent:'center', marginTop : Dimensions.get('window').width * 0.15}}>
<Image style={{height:100, width:100,backgroundColor:'white',
borderRadius: 10,
borderColor: 'black',
borderWidth: 5}} source={require('../media/img/hear.gif')}/>
</View>
</View>
</Modal>
{/* Modal Quit the Scale*/}
<Modal transparent={true} visible={this.state.showQuit} animationType="slide">
<View style={styles.modalbackground}>
......
......@@ -7,14 +7,11 @@ import {
ImageBackground,
Text,
View,
Image,
ScrollView,
BackHandler,
Pressable,
} from 'react-native';
import styles from '../style/styleSettings';
import Orientation from 'react-native-orientation';
import Notes from './data';
//import Notes from './data';
import * as RNFS from 'react-native-fs';
import NumericInput from 'react-native-numeric-input';
import AsyncStorage from '@react-native-async-storage/async-storage';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment