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
5d2eb43f
Commit
5d2eb43f
authored
Apr 17, 2023
by
Udbhasa M M S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speechtherapy text highlight
parent
5894542d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18902 additions
and
14660 deletions
+18902
-14660
App/Frontend/ReadME.md
App/Frontend/ReadME.md
+3
-1
App/Frontend/package-lock.json
App/Frontend/package-lock.json
+12276
-8920
App/Frontend/package.json
App/Frontend/package.json
+3
-1
App/Frontend/screens/SpeechTherapyScreen.js
App/Frontend/screens/SpeechTherapyScreen.js
+65
-7
App/Frontend/screens/assets/CG/content/school_sentence.m4a
App/Frontend/screens/assets/CG/content/school_sentence.m4a
+0
-0
App/Frontend/yarn.lock
App/Frontend/yarn.lock
+6555
-5731
No files found.
App/Frontend/ReadME.md
View file @
5d2eb43f
## Install instructions
nmp install expo
npm install expo
npm install react-native
npm install react-navigation
npm install @expo/vector-icons
expo install react-native-gesture-handler react-native-reanimated
expo install expo-screen-orientation
...
...
App/Frontend/package-lock.json
View file @
5d2eb43f
This diff is collapsed.
Click to expand it.
App/Frontend/package.json
View file @
5d2eb43f
...
...
@@ -14,10 +14,12 @@
"@react-navigation/stack"
:
"^6.3.16"
,
"expo"
:
"~48.0.9"
,
"expo-av"
:
"^13.2.1"
,
"expo-screen-orientation"
:
"~5.1.1"
,
"expo-status-bar"
:
"~1.4.4"
,
"react"
:
"18.2.0"
,
"react-native"
:
"0.71.4"
,
"react-native"
:
"
^
0.71.4"
,
"react-native-gesture-handler"
:
"~2.9.0"
,
"react-native-orientation-locker"
:
"^1.5.0"
,
"react-native-reanimated"
:
"~2.14.4"
,
"react-native-safe-area-context"
:
"4.5.0"
,
"react-native-screens"
:
"~3.20.0"
,
...
...
App/Frontend/screens/SpeechTherapyScreen.js
View file @
5d2eb43f
import
React
from
'
react
'
;
import
{
StyleSheet
,
Text
,
View
}
from
'
react-native
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
{
View
,
Text
,
StyleSheet
}
from
'
react-native
'
;
import
{
Audio
}
from
'
expo-av
'
;
import
*
as
ScreenOrientation
from
'
expo-screen-orientation
'
;
const
SpeechTherapyScreen
=
()
=>
{
const
[
sound
,
setSound
]
=
useState
(
null
);
const
[
progress
,
setProgress
]
=
useState
(
0
);
const
text
=
"
i go to school
"
;
const
audioPath
=
'
./assets/CG/content/school_sentence.m4a
'
;
useEffect
(()
=>
{
async
function
changeScreenOrientation
()
{
await
ScreenOrientation
.
lockAsync
(
ScreenOrientation
.
OrientationLock
.
LANDSCAPE
);
}
changeScreenOrientation
();
return
async
()
=>
{
await
ScreenOrientation
.
lockAsync
(
ScreenOrientation
.
OrientationLock
.
PORTRAIT
);
};
},
[]);
useEffect
(()
=>
{
async
function
playAudio
()
{
const
{
sound
}
=
await
Audio
.
Sound
.
createAsync
(
require
(
audioPath
),
{},
updatePlaybackStatus
,
);
setSound
(
sound
);
await
sound
.
playAsync
();
}
playAudio
();
return
()
=>
{
if
(
sound
)
{
sound
.
unloadAsync
();
}
};
},
[]);
const
updatePlaybackStatus
=
(
status
)
=>
{
if
(
status
.
isLoaded
)
{
setProgress
(
status
.
positionMillis
/
status
.
durationMillis
);
}
};
const
getCharColor
=
(
charIndex
)
=>
{
const
charProgress
=
charIndex
/
text
.
length
;
return
charProgress
<=
progress
?
'
black
'
:
'
white
'
;
};
export
default
function
ScreenName
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
text
}
>
Sample
screen
<
/Text
>
<
Text
style
=
{
styles
.
text
}
>
{
text
.
split
(
''
).
map
((
char
,
index
)
=>
(
<
Text
key
=
{
index
}
style
=
{{
color
:
getCharColor
(
index
)
}}
>
{
char
}
<
/Text
>
))}
<
/Text
>
<
/View
>
);
}
}
;
const
styles
=
StyleSheet
.
create
({
container
:
{
flex
:
1
,
backgroundColor
:
'
#
61A6AB
'
,
backgroundColor
:
'
#
FFCE6D
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
},
text
:
{
fontSize
:
24
,
color
:
'
white
'
,
},
});
export
default
SpeechTherapyScreen
;
App/Frontend/screens/assets/CG/content/school_sentence.m4a
0 → 100644
View file @
5d2eb43f
File added
App/Frontend/yarn.lock
View file @
5d2eb43f
This diff is collapsed.
Click to expand it.
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