Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pianoApp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
norhalimah
pianoApp
Commits
368e1766
Commit
368e1766
authored
Jan 20, 2021
by
norhalimah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed .......
parent
15e3b6a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
23 deletions
+82
-23
doneAlert.png
img/doneAlert.png
+0
-0
quiz.js
screens/quiz.js
+82
-23
No files found.
img/doneAlert.png
0 → 100644
View file @
368e1766
10.4 KB
screens/quiz.js
View file @
368e1766
...
@@ -601,20 +601,12 @@ class Quiz extends React.Component {
...
@@ -601,20 +601,12 @@ class Quiz extends React.Component {
};
};
homeExit
=
async
()
=>
{
homeExit
=
async
()
=>
{
// this.props.navigation.navigate('1');
this
.
setState
({
showQuit
:
true
});
Alert
.
alert
(
'Hold on!'
,
'Are you sure you want to quit?'
,
[
{
text
:
'Cancel'
,
onPress
:
()
=>
null
,
style
:
'cancel'
,
},
{
text
:
'YES'
,
onPress
:
()
=>
[
this
.
props
.
navigation
.
navigate
(
'1'
),
Orientation
.
lockToPortrait
()]},
]);
};
};
backAction
=
()
=>
{
backAction
=
()
=>
{
this
.
setState
({
showDone
:
false
});
this
.
setState
({
showDone
:
false
,
showQuit
:
false
});
this
.
props
.
navigation
.
navigate
(
'1'
);
this
.
props
.
navigation
.
navigate
(
'1'
);
Orientation
.
lockToPortrait
();
Orientation
.
lockToPortrait
();
};
};
...
@@ -789,6 +781,65 @@ this.setState({records: []});
...
@@ -789,6 +781,65 @@ this.setState({records: []});
height
:
'100%'
,
height
:
'100%'
,
}}
>
}}
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showQuit
}
animationType
=
"slide"
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
marginLeft
:
Dimensions
.
get
(
'window'
).
width
*
0.35
,
width
:
Dimensions
.
get
(
'window'
).
width
*
0.4
,
height
:
Dimensions
.
get
(
'window'
).
height
*
0.4
,
marginTop
:
Dimensions
.
get
(
'window'
).
height
*
0.25
,
alignItems
:
'center'
,
backgroundColor
:
'white'
,
borderRadius
:
10
,
borderColor
:
'black'
,
borderWidth
:
5
,
}}
>
<
Text
style
=
{{
fontSize
:
25
,
textAlign
:
'center'
,
marginTop
:
5
,
color
:
'black'
}}
>
Quit
?
<
/Text
>
<
View
style
=
{{
alignItems
:
'center'
,
flexDirection
:
'row'
,
marginTop
:
15
,
}}
>
<
TouchableOpacity
style
=
{{
backgroundColor
:
'white'
,
padding
:
15
,
borderRadius
:
10
,
marginTop
:
10
,
marginBottom
:
10
,
borderTopColor
:
'black'
,
borderRightColor
:
'black'
,
borderWidth
:
3
,
marginRight
:
5
,
}}
onPress
=
{()
=>
this
.
backAction
()}
>
<
Text
style
=
{{
color
:
'black'
}}
>
YES
<
/Text
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{{
backgroundColor
:
'white'
,
paddingLeft
:
18
,
paddingRight
:
18
,
paddingTop
:
15
,
paddingBottom
:
15
,
borderRadius
:
10
,
marginTop
:
10
,
marginBottom
:
10
,
borderWidth
:
3
,
borderTopColor
:
'black'
,
marginLeft
:
5
,
}}
onPress
=
{()
=>
this
.
setState
({
showQuit
:
false
})}
>
<
Text
style
=
{{
color
:
'black'
}}
>
NO
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showC
}
animationType
=
"slide"
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showC
}
animationType
=
"slide"
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
<
View
...
@@ -863,33 +914,41 @@ this.setState({records: []});
...
@@ -863,33 +914,41 @@ this.setState({records: []});
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showDone
}
animationType
=
"slide"
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showDone
}
animationType
=
"slide"
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
<
View
style
=
{{
style
=
{{
marginTop
:
Dimensions
.
get
(
'window'
).
height
*
0.25
,
backgroundColor
:
'white'
,
borderRadius
:
5
,
marginLeft
:
Dimensions
.
get
(
'window'
).
width
*
0.3
,
marginLeft
:
Dimensions
.
get
(
'window'
).
width
*
0.3
,
width
:
Dimensions
.
get
(
'window'
).
width
*
0.4
,
width
:
Dimensions
.
get
(
'window'
).
width
*
0.4
,
alignItems
:
'center'
,
}}
>
}}
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
10
}}
>
Well
Done
<
/Text
>
<
ImageBackground
<
Text
style
=
{{
fontSize
:
15
,
marginLeft
:
10
,
color
:
'green'
}}
>
Correct
:
{
this
.
state
.
correct
}
<
/Text
>
source
=
{
require
(
'../img/doneAlert.png'
)}
<
Text
style
=
{{
fontSize
:
15
,
marginLeft
:
10
,
color
:
'red'
}}
>
Wrong
:
{
this
.
state
.
wrong
}
<
/Text
>
style
=
{{
width
:
'120%'
,
height
:
'98%'
,
}}
>
<
Text
style
=
{{
fontSize
:
25
,
textAlign
:
'center'
,
marginTop
:
Dimensions
.
get
(
'window'
).
height
*
0.42
,
marginLeft
:
65
,
color
:
'white'
}}
>
Well
Done
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
marginLeft
:
65
,
textAlign
:
'center'
,
color
:
'green'
}}
>
Correct
:
{
this
.
state
.
correct
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
marginLeft
:
65
,
textAlign
:
'center'
,
color
:
'red'
}}
>
Wrong
:
{
this
.
state
.
wrong
}
<
/Text
>
<
View
<
View
style
=
{{
style
=
{{
alignItems
:
'flex-end'
,
alignItems
:
'center'
,
marginLeft
:
70
,
}}
>
}}
>
<
TouchableOpacity
style
=
{{
<
TouchableOpacity
style
=
{{
backgroundColor
:
'black'
,
backgroundColor
:
'white'
,
borderColor
:
'black'
,
padding
:
15
,
padding
:
15
,
borderRadius
:
5
,
borderRadius
:
5
,
margin
:
10
,
marginTop
:
5
,
marginBottom
:
10
,
}}
}}
onPress
=
{()
=>
this
.
backAction
()}
>
onPress
=
{()
=>
this
.
backAction
()}
>
<
Text
style
=
{{
color
:
'
white
'
}}
>
OK
<
/Text
>
<
Text
style
=
{{
color
:
'
black
'
}}
>
OK
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/ImageBackground
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
...
...
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