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
65de2a50
authored
Sep 25, 2019
by
likorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Animation is cancelled after answering
parent
ffb2eddd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
app/src/main/java/com/example/quickmax/TaskActivity.kt
app/src/main/java/com/example/quickmax/TaskActivity.kt
View file @
65de2a50
...
@@ -18,6 +18,7 @@ class TaskActivity : AppCompatActivity() {
...
@@ -18,6 +18,7 @@ class TaskActivity : AppCompatActivity() {
private
lateinit
var
answerSet
:
AnswerSet
private
lateinit
var
answerSet
:
AnswerSet
private
var
millisToSolve
:
Long
=
4000
private
var
millisToSolve
:
Long
=
4000
private
lateinit
var
timer
:
CountDownTimer
private
lateinit
var
timer
:
CountDownTimer
private
lateinit
var
colorAnimation
:
ValueAnimator
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
...
@@ -48,6 +49,7 @@ class TaskActivity : AppCompatActivity() {
...
@@ -48,6 +49,7 @@ class TaskActivity : AppCompatActivity() {
private
fun
processAnswer
(
correct
:
Boolean
)
{
private
fun
processAnswer
(
correct
:
Boolean
)
{
timer
.
cancel
()
timer
.
cancel
()
colorAnimation
.
cancel
()
makeButtonsUncheckable
()
makeButtonsUncheckable
()
val
responseFragment
=
ResponseFragment
.
newInstance
().
also
{
val
responseFragment
=
ResponseFragment
.
newInstance
().
also
{
...
@@ -69,7 +71,7 @@ class TaskActivity : AppCompatActivity() {
...
@@ -69,7 +71,7 @@ class TaskActivity : AppCompatActivity() {
private
fun
startProgressBarAnimation
()
{
private
fun
startProgressBarAnimation
()
{
val
colorFrom
=
Color
.
TRANSPARENT
val
colorFrom
=
Color
.
TRANSPARENT
val
colorTo
=
ContextCompat
.
getColor
(
this
,
R
.
color
.
transparent_red
)
val
colorTo
=
ContextCompat
.
getColor
(
this
,
R
.
color
.
transparent_red
)
val
colorAnimation
=
ValueAnimator
.
ofObject
(
ArgbEvaluator
(),
colorFrom
,
colorTo
)
colorAnimation
=
ValueAnimator
.
ofObject
(
ArgbEvaluator
(),
colorFrom
,
colorTo
)
colorAnimation
.
duration
=
millisToSolve
colorAnimation
.
duration
=
millisToSolve
colorAnimation
.
addUpdateListener
{
animator
->
colorAnimation
.
addUpdateListener
{
animator
->
layout_gradient
.
background
.
setColorFilter
(
animator
.
animatedValue
as
Int
,
layout_gradient
.
background
.
setColorFilter
(
animator
.
animatedValue
as
Int
,
...
...
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