Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
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
0
Merge Requests
0
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
21_22-J 38
21_22-J 38
Commits
1a539b0b
Commit
1a539b0b
authored
Feb 08, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.sliit.lk/21_22-j-38/21_22j-38
into it18257632
parents
ff2326ed
ef01cf5d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
145 additions
and
18 deletions
+145
-18
API/app.py
API/app.py
+6
-0
frontend/App.js
frontend/App.js
+2
-0
frontend/android/app/src/main/AndroidManifest.xml
frontend/android/app/src/main/AndroidManifest.xml
+8
-0
frontend/package-lock.json
frontend/package-lock.json
+40
-0
frontend/package.json
frontend/package.json
+5
-0
frontend/src/router/router.js
frontend/src/router/router.js
+1
-1
frontend/src/screen/Color.js
frontend/src/screen/Color.js
+1
-1
frontend/src/screen/activity/Blue.js
frontend/src/screen/activity/Blue.js
+82
-16
No files found.
API/app.py
View file @
1a539b0b
...
...
@@ -45,5 +45,11 @@ def abc():
if
__name__
==
"__main__"
:
<<<<<<<
HEAD
app
.
run
(
host
=
'192.168.8.102'
)
=======
app
.
run
(
host
=
'192.168.8.101'
)
# app.run(host='192.168.8.100,port='5000', debug=True)
# app.run(debug=True)
>>>>>>>
ef01cf5d3888e989084c7d61dff42b160793ac0a
frontend/App.js
View file @
1a539b0b
...
...
@@ -10,6 +10,8 @@ import {
}
from
"
react-native
"
;
import
{
LogBox
}
from
'
react-native
'
;
LogBox
.
ignoreLogs
([
'
Reanimated 2
'
]);
LogBox
.
ignoreLogs
([
'
new NativeEventEmitter
'
]);
// Ignore log notification by message
LogBox
.
ignoreAllLogs
();
//Ignore all log notifications
// import Home from "./src/screen/Home";
// import Login from "./src/screen/auth/Login"
...
...
frontend/android/app/src/main/AndroidManifest.xml
View file @
1a539b0b
...
...
@@ -2,6 +2,14 @@
package=
"com.firstapp"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-permission
android:name=
"android.permission.MICROPHONE"
/>
<uses-permission
android:name=
"android.permission.MODIFY_AUDIO_SETTINGS"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<application
android:name=
".MainApplication"
...
...
frontend/package-lock.json
View file @
1a539b0b
...
...
@@ -15,12 +15,17 @@
"native-base": "^3.2.2",
"react": "17.0.2",
"react-native": "0.66.2",
<<<<<<< HEAD
"react-native-audio-recorder-player": "^3.3.4",
"react-native-chartjs": "^1.0.3",
=======
"react-native-audio-record": "^0.2.2",
>>>>>>> ef01cf5d3888e989084c7d61dff42b160793ac0a
"react-native-elements": "^3.4.2",
"react-native-fontawesome": "^7.0.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-orientation-locker": "^1.4.0",
"react-native-permissions": "^3.2.0",
"react-native-reanimated": "^2.2.4",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.9.0",
...
...
@@ -13850,6 +13855,7 @@
"react": "17.0.2"
}
},
<<<<<<< HEAD
"node_modules/react-native-audio-recorder-player": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/react-native-audio-recorder-player/-/react-native-audio-recorder-player-3.3.4.tgz",
...
...
@@ -15642,6 +15648,12 @@
"dependencies": {
"camelcase": "^4.1.0"
}
=======
"node_modules/react-native-audio-record": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/react-native-audio-record/-/react-native-audio-record-0.2.2.tgz",
"integrity": "sha512-+JEY3AWz21xylePbXZ81DLHcqU5oJYztn3Uel3ay53P3ZrvJlwfmOmyOuoavA9boPV1O0dLLQIu9gC7xbKwNvQ=="
>>>>>>> ef01cf5d3888e989084c7d61dff42b160793ac0a
},
"node_modules/react-native-codegen": {
"version": "0.0.7",
...
...
@@ -15700,6 +15712,21 @@
"react-native-windows": ">=0.63.3"
}
},
"node_modules/react-native-permissions": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-3.2.0.tgz",
"integrity": "sha512-UPXxf2twjYL9vPI4HP2kT15AOTY489MhsNuyAgp+wJM2IRkkSVW6rO3k4WuSRL9ZmPhwkWb9bYjf8EEwRzZcXg==",
"peerDependencies": {
"react": ">=16.13.1",
"react-native": ">=0.63.3",
"react-native-windows": ">=0.62.0"
},
"peerDependenciesMeta": {
"react-native-windows": {
"optional": true
}
}
},
"node_modules/react-native-ratings": {
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-8.0.4.tgz",
...
...
@@ -29509,6 +29536,7 @@
}
}
},
<<<<<<< HEAD
"react-native-audio-recorder-player": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/react-native-audio-recorder-player/-/react-native-audio-recorder-player-3.3.4.tgz",
...
...
@@ -31029,6 +31057,12 @@
}
}
}
=======
"react-native-audio-record": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/react-native-audio-record/-/react-native-audio-record-0.2.2.tgz",
"integrity": "sha512-+JEY3AWz21xylePbXZ81DLHcqU5oJYztn3Uel3ay53P3ZrvJlwfmOmyOuoavA9boPV1O0dLLQIu9gC7xbKwNvQ=="
>>>>>>> ef01cf5d3888e989084c7d61dff42b160793ac0a
},
"react-native-codegen": {
"version": "0.0.7",
...
...
@@ -31078,6 +31112,12 @@
"integrity": "sha512-O/Ki7uw1lltKiTZLcTuLcSh4EzLFqXKKo2J4cLKvyG52YiEawbn/ipsZriZlWzK0mhX4dSe79CoRS4IsyUs1fw==",
"requires": {}
},
"react-native-permissions": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-3.2.0.tgz",
"integrity": "sha512-UPXxf2twjYL9vPI4HP2kT15AOTY489MhsNuyAgp+wJM2IRkkSVW6rO3k4WuSRL9ZmPhwkWb9bYjf8EEwRzZcXg==",
"requires": {}
},
"react-native-ratings": {
"version": "8.0.4",
"resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-8.0.4.tgz",
frontend/package.json
View file @
1a539b0b
...
...
@@ -17,12 +17,17 @@
"native-base"
:
"^3.2.2"
,
"react"
:
"17.0.2"
,
"react-native"
:
"0.66.2"
,
<<<<<<<
HEAD
"react-native-audio-recorder-player"
:
"^3.3.4"
,
"react-native-chartjs"
:
"^1.0.3"
,
=======
"react-native-audio-record"
:
"^0.2.2"
,
>>>>>>>
ef
01
cf
5
d
3888e989084
c
7
d
61
dff
42
b
160793
ac
0
a
"react-native-elements"
:
"^3.4.2"
,
"react-native-fontawesome"
:
"^7.0.0"
,
"react-native-gesture-handler"
:
"^1.10.3"
,
"react-native-orientation-locker"
:
"^1.4.0"
,
"react-native-permissions"
:
"^3.2.0"
,
"react-native-reanimated"
:
"^2.2.4"
,
"react-native-safe-area-context"
:
"^3.3.2"
,
"react-native-screens"
:
"^3.9.0"
,
...
...
frontend/src/router/router.js
View file @
1a539b0b
...
...
@@ -16,7 +16,7 @@ const Stack = createNativeStackNavigator();
const
AppRouter
=
()
=>
{
return
(
<
NavigationContainer
>
<
Stack
.
Navigator
initialRouteName
=
"
Splash
"
>
<
Stack
.
Navigator
initialRouteName
=
"
Color
"
>
<
Stack
.
Screen
options
=
{{
headerShown
:
false
}}
name
=
"
Home
"
...
...
frontend/src/screen/Color.js
View file @
1a539b0b
...
...
@@ -6,7 +6,7 @@ import { StyleSheet, View, Text, Pressable, SafeAreaView, ScrollView, Image, Ima
import
ImageButton
from
"
../component/ImageButton
"
;
import
ColorActivity
from
"
../component/colorActivity
"
;
const
webUrel
=
"
http://192.168.8.10
2
:5000/getColorActivities
"
;
const
webUrel
=
"
http://192.168.8.10
1
:5000/getColorActivities
"
;
export
default
function
Color
(){
...
...
frontend/src/screen/activity/Blue.js
View file @
1a539b0b
...
...
@@ -18,12 +18,19 @@ import {
Image
}
from
'
react-native
'
import
Permissions
from
'
react-native-permissions
'
;
import
AudioRecord
from
'
react-native-audio-record
'
;
import
axios
from
"
axios
"
;
export
default
function
Blue
(
color
)
{
const
navigation
=
useNavigation
();
const
backColor
=
color
.
route
.
params
.
color
;
React
.
useEffect
(()
=>
{
audioInit
();
const
unsubscribe
=
navigation
.
addListener
(
"
focus
"
,
()
=>
{
// The screen is focused
// Call any action
...
...
@@ -34,9 +41,68 @@ export default function Blue(color) {
return
unsubscribe
;
},
[
navigation
]);
return
(
// audioInit
function
audioInit
()
{
// console.log('audioInit');
const
colorAudio
=
{
sampleRate
:
16000
,
channels
:
1
,
bitsPerSample
:
16
,
wavFile
:
'
color.wav
'
,
// thise wave file name
};
AudioRecord
.
init
(
colorAudio
);
}
// checkPermission
async
function
checkPermission
()
{
// console.log('checkPermission');
const
p
=
await
Permissions
.
check
(
'
microphone
'
);
// console.log(p);
// console.log('permission check', p);
if
(
p
===
'
authorized
'
)
{
// console.log('if');
//audio start
audioStart
();
}
else
{
// console.log('else');
return
requestPermission
();
}
}
// requestPermission
async
function
requestPermission
()
{
const
p
=
await
Permissions
.
request
(
'
microphone
'
);
// console.log('permission request', p);
}
// audioStart
async
function
audioStart
()
{
// console.log('audioStart');
checkPermission
();
AudioRecord
.
start
();
setTimeout
(()
=>
{
audioStop
();
},
4000
);
}
// audioStop
async
function
audioStop
()
{
// console.log('audioStop');
let
audioFile
=
await
AudioRecord
.
stop
();
console
.
log
(
'
userFile
'
,
audioFile
);
}
return
(
<
SafeAreaView
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
View
style
=
{{
flexDirection
:
"
column
"
}}
>
<
ImageBackground
style
=
{
styles
.
image
}
source
=
{
require
(
"
../../assets/game/gameback.png
"
)}
>
<
View
>
...
...
@@ -53,15 +119,15 @@ export default function Blue(color) {
<
Image
style
=
{
styles
.
blackboard
}
source
=
{
require
(
"
../../assets/game/blackboard.png
"
)}
><
/Image
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
View
style
=
{{
width
:
180
,
height
:
180
,
backgroundColor
:
backColor
,
marginTop
:
-
370
,
marginLeft
:
455
,
borderRadius
:
100
}}
>
<
/View
>
<
/View
>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
480
}}
>
<
Button
style
=
{
styles
.
button
}
title
=
"
Recode
"
/>
<
Button
title
=
"
Return
"
color
=
"
#1DCE92
"
/>
<
Button
title
=
"
Exit
"
color
=
"
#841584
"
/>
<
View
style
=
{{
flexDirection
:
"
row
"
,
marginLeft
:
480
}}
>
<
Button
style
=
{
styles
.
button
}
title
=
"
Recode
"
onPress
=
{()
=>
{
audioStart
();
}}
/
>
<
Button
title
=
"
Return
"
color
=
"
#1DCE92
"
/>
<
Button
title
=
"
Exit
"
color
=
"
#841584
"
/>
<
/View
>
<
/ImageBackground
>
...
...
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