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
4e411cc6
authored
Sep 25, 2019
by
likorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Different colors are used for highlighting correct and wrong answers
parent
df14831a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
app/src/main/java/com/example/quickmax/TaskActivity.kt
app/src/main/res/layout/fragment_time_is_over.xml
app/src/main/res/values/strings.xml
app/src/main/java/com/example/quickmax/TaskActivity.kt
View file @
4e411cc6
...
...
@@ -51,7 +51,13 @@ class TaskActivity : AppCompatActivity() {
private
fun
processAnswer
(
answer
:
Answer
)
{
timer
.
cancel
()
colorAnimation
.
cancel
()
findViewById
<
CardView
>(
answer
.
cardId
).
setCardBackgroundColor
(
resources
.
getColor
(
R
.
color
.
colorAccent
))
if
(
answer
.
correct
)
findViewById
<
CardView
>(
answer
.
cardId
).
setCardBackgroundColor
(
resources
.
getColor
(
R
.
color
.
colorAccent
))
else
{
findViewById
<
CardView
>(
answer
.
cardId
).
setCardBackgroundColor
(
resources
.
getColor
(
R
.
color
.
colorPrimary
))
(
findViewById
<
CardView
>(
answer
.
cardId
).
getChildAt
(
0
)
as
TextView
).
setTextColor
(
Color
.
WHITE
)
}
makeButtonsUncheckable
()
val
responseFragment
=
ResponseFragment
.
newInstance
().
also
{
...
...
app/src/main/res/layout/fragment_time_is_over.xml
View file @
4e411cc6
...
...
@@ -34,7 +34,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"32dp"
android:text=
"
Tap to
continue"
android:text=
"
@string/tap_to_
continue"
android:textAppearance=
"@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor=
"#97000000"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
app/src/main/res/values/strings.xml
View file @
4e411cc6
...
...
@@ -10,4 +10,5 @@
<string
name=
"how_many_digits"
>
HOW MANY DIGITS?
</string>
<string
name=
"time_to_solve"
>
Time to solve: %1$s seconds
</string>
<string
name=
"btn_next"
>
Next
</string>
<string
name=
"tap_to_continue"
>
Tap anywhere to continue
</string>
</resources>
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