Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
quick_max
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
625fb6d3
authored
Sep 26, 2019
by
likorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug; now the cards are disabled after one has been clicked
parent
b2b04b68
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
app/src/main/java/com/example/quickmax/TaskActivity.kt
app/src/main/java/com/example/quickmax/TaskActivity.kt
View file @
625fb6d3
...
@@ -34,7 +34,7 @@ class TaskActivity : AppCompatActivity() {
...
@@ -34,7 +34,7 @@ class TaskActivity : AppCompatActivity() {
private
fun
startNewRound
()
{
private
fun
startNewRound
()
{
answerSet
=
AnswerSet
(
numDigits
,
listOf
(
card_left_top
,
card_right_top
,
card_left_bottom
,
card_right_bottom
))
answerSet
=
AnswerSet
(
numDigits
,
listOf
(
card_left_top
,
card_right_top
,
card_left_bottom
,
card_right_bottom
))
setUp
Button
s
()
setUp
Card
s
()
timer
.
start
()
timer
.
start
()
startProgressBarAnimation
()
startProgressBarAnimation
()
}
}
...
@@ -44,10 +44,11 @@ class TaskActivity : AppCompatActivity() {
...
@@ -44,10 +44,11 @@ class TaskActivity : AppCompatActivity() {
millisToSolve
=
1000
*
intent
.
getIntExtra
(
"sec_to_solve"
,
4
).
toLong
()
millisToSolve
=
1000
*
intent
.
getIntExtra
(
"sec_to_solve"
,
4
).
toLong
()
}
}
private
fun
setUp
Button
s
()
{
private
fun
setUp
Card
s
()
{
for
(
answer
in
answerSet
)
{
for
(
answer
in
answerSet
)
{
getTextView
(
answer
.
card
).
text
=
answer
.
value
.
toString
()
getTextView
(
answer
.
card
).
text
=
answer
.
value
.
toString
()
getTextView
(
answer
.
card
).
setTextColor
(
color
(
this
,
R
.
color
.
transparent_black
))
getTextView
(
answer
.
card
).
setTextColor
(
color
(
this
,
R
.
color
.
transparent_black
))
answer
.
card
.
isEnabled
=
true
answer
.
card
.
setOnClickListener
{
processAnswer
(
answer
)
}
answer
.
card
.
setOnClickListener
{
processAnswer
(
answer
)
}
answer
.
card
.
setCardBackgroundColor
(
Color
.
WHITE
)
answer
.
card
.
setCardBackgroundColor
(
Color
.
WHITE
)
}
}
...
@@ -62,7 +63,7 @@ class TaskActivity : AppCompatActivity() {
...
@@ -62,7 +63,7 @@ class TaskActivity : AppCompatActivity() {
timer
.
cancel
()
timer
.
cancel
()
colorAnimation
.
cancel
()
colorAnimation
.
cancel
()
setResponseText
(
answer
)
setResponseText
(
answer
)
makeButtonsUncheckable
()
disableCards
()
}
}
private
fun
setResponseText
(
answer
:
Answer
)
{
private
fun
setResponseText
(
answer
:
Answer
)
{
...
@@ -83,9 +84,9 @@ class TaskActivity : AppCompatActivity() {
...
@@ -83,9 +84,9 @@ class TaskActivity : AppCompatActivity() {
}
}
}
}
private
fun
makeButtonsUncheckable
()
{
private
fun
disableCards
()
{
for
(
answer
in
answerSet
)
{
for
(
answer
in
answerSet
)
{
answer
.
card
.
is
Clickable
=
false
answer
.
card
.
is
Enabled
=
false
}
}
}
}
...
...
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