Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
linphone-desktop
Commits
3fdaa51c
Commit
3fdaa51c
authored
Oct 19, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Animations/CaterpillarAnimation): better animation
parent
681b3512
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
20 deletions
+67
-20
CaterpillarAnimation.qml
tests/ui/modules/Common/Animations/CaterpillarAnimation.qml
+67
-20
No files found.
tests/ui/modules/Common/Animations/CaterpillarAnimation.qml
View file @
3fdaa51c
...
...
@@ -3,44 +3,91 @@ import QtQuick 2.7
Row
{
id
:
container
property
int
sphereSize
:
1
0
property
int
duration
:
20
0
property
int
nSpheres
:
3
property
color
sphereColor
:
'
#8F8F8F
'
property
int
sphereSize
:
10
property
int
sphereSpaceSize
:
10
spacing
:
6
Repeater
{
id
:
repeater
model
:
nSpheres
Rectangle
{
id
:
ymovingBox
id
:
sphere
color
:
'
#8F8F8F
'
height
:
container
.
sphereSize
radius
:
container
.
sphereSize
/
2
property
bool
forceRunning
:
false
property
int
previousY
:
0
function
startAnimation
()
{
if
(
!
animator
.
running
)
{
animator
.
running
=
true
}
else
{
forceRunning
=
true
}
}
color
:
sphereColor
height
:
width
radius
:
width
/
2
width
:
container
.
sphereSize
onYChanged
:
console
.
log
(
'
y changed
'
,
y
)
onYChanged
:
{
// No call executed by last sphere.
if
(
index
===
nSpheres
-
1
)
{
return
}
if
(
y
===
(
sphereSpaceSize
/
2
)
&&
previousY
===
0
)
{
repeater
.
itemAt
(
index
+
1
).
startAnimation
()
}
previousY
=
y
}
Component.onCompleted
:
{
// Only start first sphere.
if
(
index
===
0
)
{
animator
.
running
=
true
}
}
YAnimator
on
y
{
duration
:
container
.
duration
from
:
0
id
:
animator
duration
:
500
from
:
10
running
:
true
to
:
0
running
:
false
to
:
sphereSpaceSize
/
2
onRunningChanged
:
{
if
(
!
running
)
{
if
(
to
===
0
)
{
to
=
10
from
=
0
}
else
{
to
=
0
from
=
10
}
if
(
running
)
{
return
}
var
mid
=
sphereSpaceSize
/
2
if
(
from
===
sphereSpaceSize
&&
to
===
mid
)
{
from
=
mid
to
=
0
}
else
if
(
from
===
mid
&&
to
===
0
)
{
from
=
0
to
=
mid
animator
.
running
=
true
if
(
index
!==
0
&&
!
forceRunning
)
{
return
}
}
else
if
(
from
===
0
&&
to
===
mid
)
{
from
=
mid
to
=
sphereSpaceSize
}
else
{
from
=
sphereSpaceSize
to
=
mid
}
forceRunning
=
false
animator
.
running
=
true
}
}
}
...
...
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