Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
22_23-J 18
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23-J 18
22_23-J 18
Commits
90633411
Commit
90633411
authored
Apr 18, 2023
by
Udbhasa M M S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phonetic word screen
parent
059e94b6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
167 additions
and
37 deletions
+167
-37
App/Frontend/screens/PhoneticWordsScreen.js
App/Frontend/screens/PhoneticWordsScreen.js
+101
-12
App/Frontend/screens/SpeechTherapyScreen.js
App/Frontend/screens/SpeechTherapyScreen.js
+66
-25
App/Frontend/screens/assets/ST/content/bat.m4a
App/Frontend/screens/assets/ST/content/bat.m4a
+0
-0
App/Frontend/screens/assets/ST/content/battle.m4a
App/Frontend/screens/assets/ST/content/battle.m4a
+0
-0
App/Frontend/screens/assets/ST/content/bottle.m4a
App/Frontend/screens/assets/ST/content/bottle.m4a
+0
-0
App/Frontend/screens/assets/ST/content/cat.m4a
App/Frontend/screens/assets/ST/content/cat.m4a
+0
-0
App/Frontend/screens/assets/ST/content/kettle.m4a
App/Frontend/screens/assets/ST/content/kettle.m4a
+0
-0
App/Frontend/screens/assets/ST/content/rat.m4a
App/Frontend/screens/assets/ST/content/rat.m4a
+0
-0
App/Frontend/screens/assets/ST/woodboard.png
App/Frontend/screens/assets/ST/woodboard.png
+0
-0
No files found.
App/Frontend/screens/PhoneticWordsScreen.js
View file @
90633411
import
React
from
'
react
'
;
import
{
StyleSheet
,
Text
,
View
}
from
'
react-native
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
ImageBackground
,
TouchableOpacity
,
Image
,
Dimensions
,
}
from
'
react-native
'
;
import
{
Audio
}
from
'
expo-av
'
;
import
*
as
ScreenOrientation
from
'
expo-screen-orientation
'
;
const
PhoneticWordsScreen
=
()
=>
{
const
words
=
[
'
battle
'
,
'
kettle
'
,
'
bottle
'
,
'
rat
'
,
'
bat
'
,
'
cat
'
];
const
backgroundPath
=
'
./assets/ST/st_bg.png
'
;
const
woodboardPath
=
'
./assets/ST/woodboard.png
'
;
const
audioFiles
=
{
battle
:
require
(
'
./assets/ST/content/battle.m4a
'
),
kettle
:
require
(
'
./assets/ST/content/kettle.m4a
'
),
bottle
:
require
(
'
./assets/ST/content/bottle.m4a
'
),
rat
:
require
(
'
./assets/ST/content/rat.m4a
'
),
bat
:
require
(
'
./assets/ST/content/bat.m4a
'
),
cat
:
require
(
'
./assets/ST/content/cat.m4a
'
),
};
useEffect
(()
=>
{
async
function
changeScreenOrientation
()
{
await
ScreenOrientation
.
lockAsync
(
ScreenOrientation
.
OrientationLock
.
LANDSCAPE
);
}
changeScreenOrientation
();
return
async
()
=>
{
await
ScreenOrientation
.
lockAsync
(
ScreenOrientation
.
OrientationLock
.
PORTRAIT
);
};
},
[]);
const
playAudio
=
async
(
audio
)
=>
{
const
{
sound
}
=
await
Audio
.
Sound
.
createAsync
(
audio
);
await
sound
.
playAsync
();
sound
.
setOnPlaybackStatusUpdate
(
async
(
status
)
=>
{
if
(
status
.
didJustFinish
)
{
sound
.
unloadAsync
();
}
});
};
const
handleBoxPress
=
(
word
)
=>
{
playAudio
(
audioFiles
[
word
]);
};
export
default
function
ScreenName
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
text
}
>
Sample
screen
<
/Text
>
<
/View
>
<
ImageBackground
source
=
{
require
(
backgroundPath
)}
style
=
{
styles
.
container
}
resizeMode
=
"
cover
"
>
{
words
.
map
((
word
,
index
)
=>
(
<
TouchableOpacity
key
=
{
word
}
style
=
{[
styles
.
box
,
{
marginLeft
:
(
index
%
3
)
*
(
Dimensions
.
get
(
'
window
'
).
width
/
3
),
marginTop
:
Math
.
floor
(
index
/
3
)
*
(
Dimensions
.
get
(
'
window
'
).
height
/
2
),
},
]}
onPress
=
{()
=>
handleBoxPress
(
word
)}
>
<
ImageBackground
source
=
{
require
(
woodboardPath
)}
style
=
{
styles
.
wordBackground
}
resizeMode
=
"
cover
"
>
<
Text
style
=
{
styles
.
wordText
}
>
{
word
}
<
/Text
>
<
/ImageBackground
>
<
/TouchableOpacity
>
))}
<
/ImageBackground
>
);
}
}
;
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'
#61A6AB
'
,
alignItems
:
'
center
'
,
backgroundColor
:
'
#FFCE6D
'
,
},
box
:
{
width
:
'
33.33%
'
,
height
:
'
50%
'
,
position
:
'
absolute
'
,
},
wordBackground
:
{
top
:
35
,
left
:
25
,
width
:
'
90%
'
,
height
:
'
80%
'
,
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
,
},
text
:
{
fontSize
:
24
,
color
:
'
white
'
,
wordText
:
{
fontSize
:
48
,
fontWeight
:
'
bold
'
,
color
:
'
#FFCE6D
'
,
bottom
:
15
,
},
});
export
default
PhoneticWordsScreen
;
App/Frontend/screens/SpeechTherapyScreen.js
View file @
90633411
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
,
ImageBackground
,
TouchableOpacity
,
Image
}
from
'
react-native
'
;
import
{
View
,
Text
,
StyleSheet
,
ImageBackground
,
TouchableOpacity
,
Image
,
TouchableWithoutFeedback
,
}
from
'
react-native
'
;
import
{
Audio
}
from
'
expo-av
'
;
import
*
as
ScreenOrientation
from
'
expo-screen-orientation
'
;
...
...
@@ -13,6 +21,19 @@ const SpeechTherapyScreen = ({ navigation }) => {
const
buttonPath
=
'
./assets/ST/next.png
'
;
const
owlPath
=
'
./assets/ST/owl.png
'
;
const
handleScreenTouch
=
async
()
=>
{
if
(
sound
)
{
await
sound
.
unloadAsync
();
}
const
{
sound
:
newSound
}
=
await
Audio
.
Sound
.
createAsync
(
require
(
audioPath
),
{},
updatePlaybackStatus
,
);
setSound
(
newSound
);
await
newSound
.
playAsync
();
};
useEffect
(()
=>
{
async
function
changeScreenOrientation
()
{
await
ScreenOrientation
.
lockAsync
(
ScreenOrientation
.
OrientationLock
.
LANDSCAPE
);
...
...
@@ -60,37 +81,57 @@ const SpeechTherapyScreen = ({ navigation }) => {
navigation
.
navigate
(
'
PhoneticWord
'
);
};
return
(
<
View
style
=
{
styles
.
container
}
>
const
screenBackgroundPath
=
'
./assets/ST/st_bg.png
'
;
<
View
style
=
{
styles
.
backgroundWrapper
}
>
return
(
<
View
style
=
{
styles
.
container
}
>
<
ImageBackground
source
=
{
require
(
backgroundPath
)}
style
=
{
styles
.
backgroundImage
}
resizeMode
=
"
contain
"
>
<
Text
style
=
{
styles
.
text
}
>
{
text
.
split
(
''
).
map
((
char
,
index
)
=>
(
<
Text
key
=
{
index
}
style
=
{{
color
:
getCharColor
(
index
)
}}
>
{
char
}
<
/Text
>
))}
<
/Text
>
<
/ImageBackground
>
source
=
{
require
(
screenBackgroundPath
)}
style
=
{
styles
.
background
}
resizeMode
=
"
cover
"
/>
<
TouchableWithoutFeedback
onPress
=
{
handleScreenTouch
}
>
<
View
style
=
{
styles
.
content
}
>
<
View
style
=
{
styles
.
backgroundWrapper
}
>
<
ImageBackground
source
=
{
require
(
backgroundPath
)}
style
=
{
styles
.
backgroundImage
}
resizeMode
=
"
contain
"
>
<
Text
style
=
{
styles
.
text
}
>
{
text
.
split
(
''
).
map
((
char
,
index
)
=>
(
<
Text
key
=
{
index
}
style
=
{{
color
:
getCharColor
(
index
)
}}
>
{
char
}
<
/Text
>
))}
<
/Text
>
<
/ImageBackground
>
<
/View
>
<
TouchableOpacity
onPress
=
{
navigateToPhoneticWords
}
style
=
{
styles
.
button
}
>
<
Image
source
=
{
require
(
buttonPath
)}
style
=
{
styles
.
buttonImage
}
/
>
<
/TouchableOpacity
>
<
Image
source
=
{
require
(
owlPath
)}
style
=
{
styles
.
owlImage
}
/
>
<
/View
>
<
/TouchableWithoutFeedback
>
<
/View
>
<
TouchableOpacity
onPress
=
{
navigateToPhoneticWords
}
style
=
{
styles
.
button
}
>
<
Image
source
=
{
require
(
buttonPath
)}
style
=
{
styles
.
buttonImage
}
/
>
<
/TouchableOpacity
>
<
Image
source
=
{
require
(
owlPath
)}
style
=
{
styles
.
owlImage
}
/
>
<
/View
>
);
);
};
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'
#FFCE6D
'
,
},
background
:
{
position
:
'
absolute
'
,
top
:
0
,
left
:
0
,
right
:
0
,
bottom
:
0
,
},
content
:
{
flex
:
1
,
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
},
...
...
@@ -112,8 +153,8 @@ const styles = StyleSheet.create({
},
button
:
{
position
:
'
absolute
'
,
bottom
:
1
0
,
right
:
1
0
,
bottom
:
2
0
,
right
:
2
0
,
},
buttonImage
:
{
width
:
50
,
...
...
App/Frontend/screens/assets/ST/content/bat.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/content/battle.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/content/bottle.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/content/cat.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/content/kettle.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/content/rat.m4a
0 → 100644
View file @
90633411
File added
App/Frontend/screens/assets/ST/woodboard.png
0 → 100644
View file @
90633411
953 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment