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
3e1cdccc
Commit
3e1cdccc
authored
Nov 14, 2015
by
danieldahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated MaterialAnimation method name
parent
4d0765c9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
Source/MaterialAnimation.swift
+3
-3
Source/MaterialButton.swift
+1
-1
Source/MaterialPulseCollectionViewCell.swift
+2
-2
Source/MaterialPulseView.swift
+1
-1
Source/SideNavigationViewController.swift
+3
-3
No files found.
Source/MaterialAnimation.swift
View file @
3e1cdccc
...
@@ -54,13 +54,13 @@ public struct MaterialAnimation {
...
@@ -54,13 +54,13 @@ public struct MaterialAnimation {
:name: animationDisabled
:name: animationDisabled
*/
*/
public
static
func
animationDisabled
(
animations
:
(()
->
Void
))
{
public
static
func
animationDisabled
(
animations
:
(()
->
Void
))
{
animat
ion
WithDuration
(
0
,
animations
:
animations
)
animat
e
WithDuration
(
0
,
animations
:
animations
)
}
}
/**
/**
:name: animat
ion
WithDuration
:name: animat
e
WithDuration
*/
*/
public
static
func
animat
ion
WithDuration
(
duration
:
CFTimeInterval
,
animations
:
(()
->
Void
),
options
:
UIViewAnimationOptions
?
=
nil
,
completion
:
(()
->
Void
)?
=
nil
)
{
public
static
func
animat
e
WithDuration
(
duration
:
CFTimeInterval
,
animations
:
(()
->
Void
),
options
:
UIViewAnimationOptions
?
=
nil
,
completion
:
(()
->
Void
)?
=
nil
)
{
CATransaction
.
begin
()
CATransaction
.
begin
()
CATransaction
.
setAnimationDuration
(
duration
)
CATransaction
.
setAnimationDuration
(
duration
)
CATransaction
.
setCompletionBlock
(
completion
)
CATransaction
.
setCompletionBlock
(
completion
)
...
...
Source/MaterialButton.swift
View file @
3e1cdccc
...
@@ -505,7 +505,7 @@ public class MaterialButton : UIButton {
...
@@ -505,7 +505,7 @@ public class MaterialButton : UIButton {
let
s
:
CGFloat
=
1
let
s
:
CGFloat
=
1
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
MaterialAnimation
.
animat
ion
WithDuration
(
t
,
animations
:
{
MaterialAnimation
.
animat
e
WithDuration
(
t
,
animations
:
{
self
.
pulseLayer
.
hidden
=
true
self
.
pulseLayer
.
hidden
=
true
})
})
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
...
...
Source/MaterialPulseCollectionViewCell.swift
View file @
3e1cdccc
...
@@ -414,7 +414,7 @@ public class MaterialPulseCollectionViewCell : UICollectionViewCell {
...
@@ -414,7 +414,7 @@ public class MaterialPulseCollectionViewCell : UICollectionViewCell {
MaterialAnimation
.
animationDisabled
{
MaterialAnimation
.
animationDisabled
{
self
.
pulseLayer
.
bounds
=
CGRectMake
(
0
,
0
,
2
*
w
,
2
*
h
)
self
.
pulseLayer
.
bounds
=
CGRectMake
(
0
,
0
,
2
*
w
,
2
*
h
)
}
}
MaterialAnimation
.
animat
ion
WithDuration
(
t
,
animations
:
{
MaterialAnimation
.
animat
e
WithDuration
(
t
,
animations
:
{
self
.
pulseLayer
.
hidden
=
false
self
.
pulseLayer
.
hidden
=
false
})
})
}
}
...
@@ -507,7 +507,7 @@ public class MaterialPulseCollectionViewCell : UICollectionViewCell {
...
@@ -507,7 +507,7 @@ public class MaterialPulseCollectionViewCell : UICollectionViewCell {
let
s
:
CGFloat
=
1
let
s
:
CGFloat
=
1
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
MaterialAnimation
.
animat
ion
WithDuration
(
t
,
animations
:
{
MaterialAnimation
.
animat
e
WithDuration
(
t
,
animations
:
{
self
.
pulseLayer
.
hidden
=
true
self
.
pulseLayer
.
hidden
=
true
})
})
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
...
...
Source/MaterialPulseView.swift
View file @
3e1cdccc
...
@@ -183,7 +183,7 @@ public class MaterialPulseView : MaterialView {
...
@@ -183,7 +183,7 @@ public class MaterialPulseView : MaterialView {
let
s
:
CGFloat
=
1
let
s
:
CGFloat
=
1
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
if
nil
!=
pulseColor
&&
0
<
pulseColorOpacity
{
MaterialAnimation
.
animat
ion
WithDuration
(
t
,
animations
:
{
MaterialAnimation
.
animat
e
WithDuration
(
t
,
animations
:
{
self
.
pulseLayer
.
hidden
=
true
self
.
pulseLayer
.
hidden
=
true
})
})
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
pulseLayer
.
addAnimation
(
MaterialAnimation
.
scale
(
s
,
duration
:
t
),
forKey
:
nil
)
...
...
Source/SideNavigationViewController.swift
View file @
3e1cdccc
...
@@ -183,7 +183,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -183,7 +183,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
let
w
:
CGFloat
=
(
hidden
?
-
width
:
width
)
/
2
let
w
:
CGFloat
=
(
hidden
?
-
width
:
width
)
/
2
if
animated
{
if
animated
{
MaterialAnimation
.
animat
ion
WithDuration
(
0.25
,
animations
:
{
MaterialAnimation
.
animat
e
WithDuration
(
0.25
,
animations
:
{
self
.
sideView
.
width
=
width
self
.
sideView
.
width
=
width
self
.
sideView
.
position
.
x
=
w
self
.
sideView
.
position
.
x
=
w
})
{
})
{
...
@@ -210,7 +210,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -210,7 +210,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
func
open
(
velocity
:
CGFloat
=
0
)
{
public
func
open
(
velocity
:
CGFloat
=
0
)
{
toggleStatusBar
(
true
)
toggleStatusBar
(
true
)
backdropLayer
.
hidden
=
false
backdropLayer
.
hidden
=
false
MaterialAnimation
.
animat
ion
WithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
MaterialAnimation
.
animat
e
WithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
animations
:
{
animations
:
{
self
.
sideView
.
position
=
CGPointMake
(
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
self
.
sideView
.
position
=
CGPointMake
(
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
})
{
})
{
...
@@ -224,7 +224,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -224,7 +224,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
func
close
(
velocity
:
CGFloat
=
0
)
{
public
func
close
(
velocity
:
CGFloat
=
0
)
{
toggleStatusBar
(
false
)
toggleStatusBar
(
false
)
backdropLayer
.
hidden
=
true
backdropLayer
.
hidden
=
true
MaterialAnimation
.
animat
ion
WithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
MaterialAnimation
.
animat
e
WithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
animations
:
{
animations
:
{
self
.
sideView
.
position
=
CGPointMake
(
-
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
self
.
sideView
.
position
=
CGPointMake
(
-
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
})
{
})
{
...
...
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