Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
90103779
Unverified
Commit
90103779
authored
Jan 10, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated MotionAnimation types with by to to
parent
bd63f110
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
41 deletions
+41
-41
Sources/iOS/BasicMotion.swift
+39
-39
Sources/iOS/PulseMotion.swift
+2
-2
No files found.
Sources/iOS/BasicMotion.swift
View file @
90103779
...
@@ -63,14 +63,14 @@ public enum MotionAnimation {
...
@@ -63,14 +63,14 @@ public enum MotionAnimation {
case
spinX
(
rotations
:
CGFloat
)
case
spinX
(
rotations
:
CGFloat
)
case
spinY
(
rotations
:
CGFloat
)
case
spinY
(
rotations
:
CGFloat
)
case
spinZ
(
rotations
:
CGFloat
)
case
spinZ
(
rotations
:
CGFloat
)
case
scale
(
by
:
CGFloat
)
case
scale
(
to
:
CGFloat
)
case
scaleX
(
by
:
CGFloat
)
case
scaleX
(
to
:
CGFloat
)
case
scaleY
(
by
:
CGFloat
)
case
scaleY
(
to
:
CGFloat
)
case
scaleZ
(
by
:
CGFloat
)
case
scaleZ
(
to
:
CGFloat
)
case
move
(
by
:
CGPoint
)
case
move
(
to
:
CGPoint
)
case
moveX
(
by
:
CGFloat
)
case
moveX
(
to
:
CGFloat
)
case
moveY
(
by
:
CGFloat
)
case
moveY
(
to
:
CGFloat
)
case
moveZ
(
by
:
CGFloat
)
case
moveZ
(
to
:
CGFloat
)
case
position
(
to
:
CGPoint
)
case
position
(
to
:
CGPoint
)
case
shadow
(
path
:
CGPath
)
case
shadow
(
path
:
CGPath
)
case
fade
(
opacity
:
CGFloat
)
case
fade
(
opacity
:
CGFloat
)
...
@@ -189,22 +189,22 @@ extension CALayer {
...
@@ -189,22 +189,22 @@ extension CALayer {
a
.
append
(
Motion
.
spinY
(
rotations
:
rotations
))
a
.
append
(
Motion
.
spinY
(
rotations
:
rotations
))
case
let
.
spinZ
(
rotations
):
case
let
.
spinZ
(
rotations
):
a
.
append
(
Motion
.
spinZ
(
rotations
:
rotations
))
a
.
append
(
Motion
.
spinZ
(
rotations
:
rotations
))
case
let
.
scale
(
by
):
case
let
.
scale
(
to
):
a
.
append
(
Motion
.
scale
(
by
:
by
))
a
.
append
(
Motion
.
scale
(
to
:
to
))
case
let
.
scaleX
(
by
):
case
let
.
scaleX
(
to
):
a
.
append
(
Motion
.
scaleX
(
by
:
by
))
a
.
append
(
Motion
.
scaleX
(
to
:
to
))
case
let
.
scaleY
(
by
):
case
let
.
scaleY
(
to
):
a
.
append
(
Motion
.
scaleY
(
by
:
by
))
a
.
append
(
Motion
.
scaleY
(
to
:
to
))
case
let
.
scaleZ
(
by
):
case
let
.
scaleZ
(
to
):
a
.
append
(
Motion
.
scaleZ
(
by
:
by
))
a
.
append
(
Motion
.
scaleZ
(
to
:
to
))
case
let
.
move
(
by
):
case
let
.
move
(
to
):
a
.
append
(
Motion
.
move
(
by
:
by
))
a
.
append
(
Motion
.
move
(
to
:
to
))
case
let
.
moveX
(
by
):
case
let
.
moveX
(
to
):
a
.
append
(
Motion
.
moveX
(
by
:
by
))
a
.
append
(
Motion
.
moveX
(
to
:
to
))
case
let
.
moveY
(
by
):
case
let
.
moveY
(
to
):
a
.
append
(
Motion
.
moveY
(
by
:
by
))
a
.
append
(
Motion
.
moveY
(
to
:
to
))
case
let
.
moveZ
(
by
):
case
let
.
moveZ
(
to
):
a
.
append
(
Motion
.
moveZ
(
by
:
by
))
a
.
append
(
Motion
.
moveZ
(
to
:
to
))
case
let
.
position
(
to
):
case
let
.
position
(
to
):
a
.
append
(
Motion
.
position
(
to
:
to
))
a
.
append
(
Motion
.
position
(
to
:
to
))
case
let
.
shadow
(
path
):
case
let
.
shadow
(
path
):
...
@@ -460,10 +460,10 @@ extension Motion {
...
@@ -460,10 +460,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.scale key path.
Creates a CABasicAnimation for the transform.scale key path.
- Parameter
by
scale: A CGFloat.
- Parameter
to
scale: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
scale
(
by
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
scale
(
to
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
scale
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
scale
)
animation
.
toValue
=
scale
as
NSNumber
animation
.
toValue
=
scale
as
NSNumber
return
animation
return
animation
...
@@ -471,10 +471,10 @@ extension Motion {
...
@@ -471,10 +471,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.scale.x key path.
Creates a CABasicAnimation for the transform.scale.x key path.
- Parameter
by
scale: A CGFloat.
- Parameter
to
scale: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
scaleX
(
by
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
scaleX
(
to
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleX
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleX
)
animation
.
toValue
=
scale
as
NSNumber
animation
.
toValue
=
scale
as
NSNumber
return
animation
return
animation
...
@@ -482,10 +482,10 @@ extension Motion {
...
@@ -482,10 +482,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.scale.y key path.
Creates a CABasicAnimation for the transform.scale.y key path.
- Parameter
by
scale: A CGFloat.
- Parameter
to
scale: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
scaleY
(
by
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
scaleY
(
to
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleY
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleY
)
animation
.
toValue
=
scale
as
NSNumber
animation
.
toValue
=
scale
as
NSNumber
return
animation
return
animation
...
@@ -493,10 +493,10 @@ extension Motion {
...
@@ -493,10 +493,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.scale.z key path.
Creates a CABasicAnimation for the transform.scale.z key path.
- Parameter
by
scale: A CGFloat.
- Parameter
to
scale: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
scaleZ
(
by
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
scaleZ
(
to
scale
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleZ
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
scaleZ
)
animation
.
toValue
=
scale
as
NSNumber
animation
.
toValue
=
scale
as
NSNumber
return
animation
return
animation
...
@@ -507,7 +507,7 @@ extension Motion {
...
@@ -507,7 +507,7 @@ extension Motion {
- Parameter point: A CGPoint.
- Parameter point: A CGPoint.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
move
(
by
point
:
CGPoint
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
move
(
to
point
:
CGPoint
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
translation
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
translation
)
animation
.
toValue
=
NSValue
(
cgPoint
:
point
)
animation
.
toValue
=
NSValue
(
cgPoint
:
point
)
return
animation
return
animation
...
@@ -515,10 +515,10 @@ extension Motion {
...
@@ -515,10 +515,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.translation.x key path.
Creates a CABasicAnimation for the transform.translation.x key path.
- Parameter
by
translation: A CGFloat.
- Parameter
to
translation: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
moveX
(
by
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
moveX
(
to
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationX
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationX
)
animation
.
toValue
=
translation
as
NSNumber
animation
.
toValue
=
translation
as
NSNumber
return
animation
return
animation
...
@@ -526,10 +526,10 @@ extension Motion {
...
@@ -526,10 +526,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.translation.y key path.
Creates a CABasicAnimation for the transform.translation.y key path.
- Parameter
by
translation: A CGFloat.
- Parameter
to
translation: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
moveY
(
by
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
moveY
(
to
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationY
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationY
)
animation
.
toValue
=
translation
as
NSNumber
animation
.
toValue
=
translation
as
NSNumber
return
animation
return
animation
...
@@ -537,10 +537,10 @@ extension Motion {
...
@@ -537,10 +537,10 @@ extension Motion {
/**
/**
Creates a CABasicAnimation for the transform.translation.z key path.
Creates a CABasicAnimation for the transform.translation.z key path.
- Parameter
by
translation: A CGFloat.
- Parameter
to
translation: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
*/
*/
public
static
func
moveZ
(
by
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
public
static
func
moveZ
(
to
translation
:
CGFloat
,
duration
:
CFTimeInterval
?
=
nil
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationZ
)
let
animation
=
CABasicAnimation
(
keyPath
:
.
translationZ
)
animation
.
toValue
=
translation
as
NSNumber
animation
.
toValue
=
translation
as
NSNumber
return
animation
return
animation
...
...
Sources/iOS/PulseMotion.swift
View file @
90103779
...
@@ -152,7 +152,7 @@ extension PulseMotion {
...
@@ -152,7 +152,7 @@ extension PulseMotion {
switch
animation
{
switch
animation
{
case
.
center
,
.
centerWithBacking
,
.
centerRadialBeyondBounds
,
.
radialBeyondBounds
,
.
point
,
.
pointWithBacking
:
case
.
center
,
.
centerWithBacking
,
.
centerRadialBeyondBounds
,
.
radialBeyondBounds
,
.
point
,
.
pointWithBacking
:
pLayer
.
motion
(
duration
:
duration
,
animations
:
.
scale
(
by
:
1
))
pLayer
.
motion
(
duration
:
duration
,
animations
:
.
scale
(
to
:
1
))
default
:
break
default
:
break
}
}
...
@@ -188,7 +188,7 @@ extension PulseMotion {
...
@@ -188,7 +188,7 @@ extension PulseMotion {
switch
animation
{
switch
animation
{
case
.
center
,
.
centerWithBacking
,
.
centerRadialBeyondBounds
,
.
radialBeyondBounds
,
.
point
,
.
pointWithBacking
:
case
.
center
,
.
centerWithBacking
,
.
centerRadialBeyondBounds
,
.
radialBeyondBounds
,
.
point
,
.
pointWithBacking
:
pLayer
.
motion
(
duration
:
duration
,
animations
:
.
scale
(
by
:
.
center
==
animation
?
1
:
1.325
),
.
background
(
color
:
color
.
withAlphaComponent
(
0
)))
pLayer
.
motion
(
duration
:
duration
,
animations
:
.
scale
(
to
:
.
center
==
animation
?
1
:
1.325
),
.
background
(
color
:
color
.
withAlphaComponent
(
0
)))
default
:
break
default
:
break
}
}
...
...
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