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
80b03f9c
Commit
80b03f9c
authored
Feb 02, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated MaterialView to better handle UIView animations
parent
a3dba3f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
8 deletions
+55
-8
Examples/Programmatic/MaterialButton/MaterialButton/ViewController.swift
+7
-6
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
+25
-1
Examples/Programmatic/MaterialView/MaterialView/ViewController.swift
+23
-1
No files found.
Examples/Programmatic/MaterialButton/MaterialButton/ViewController.swift
View file @
80b03f9c
...
@@ -40,10 +40,10 @@ class ViewController: UIViewController {
...
@@ -40,10 +40,10 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
//
prepareFlatButtonExample()
prepareFlatButtonExample
()
//
prepareRaisedButtonExample()
prepareRaisedButtonExample
()
//
prepareFabButtonExample()
prepareFabButtonExample
()
prepareFabButtonAnimationExample
()
//
prepareFabButtonAnimationExample()
}
}
/// General preparation statements.
/// General preparation statements.
...
@@ -96,9 +96,10 @@ class ViewController: UIViewController {
...
@@ -96,9 +96,10 @@ class ViewController: UIViewController {
delay
:
3
,
delay
:
3
,
usingSpringWithDamping
:
0.6
,
usingSpringWithDamping
:
0.6
,
initialSpringVelocity
:
0
,
initialSpringVelocity
:
0
,
options
:
.
AllowUserInteraction
,
animations
:
{
options
:
.
AllowUserInteraction
,
animations
:
{
button
.
frame
.
origin
.
x
=
300
button
.
frame
.
origin
.
x
=
300
},
completion
:
nil
)
},
completion
:
nil
)
}
}
}
}
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
View file @
80b03f9c
...
@@ -41,7 +41,8 @@ class ViewController: UIViewController {
...
@@ -41,7 +41,8 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
prepareGeneralMaterialPulseViewExample
()
// prepareGeneralMaterialPulseViewExample()
prepareMaterialPulseViewAnimationExample
()
}
}
/// General preparation statements.
/// General preparation statements.
...
@@ -60,5 +61,28 @@ class ViewController: UIViewController {
...
@@ -60,5 +61,28 @@ class ViewController: UIViewController {
// Add pulseView to UIViewController.
// Add pulseView to UIViewController.
view
.
addSubview
(
pulseView
)
view
.
addSubview
(
pulseView
)
}
}
/// Prepares the MaterialPulseView animation example.
private
func
prepareMaterialPulseViewAnimationExample
()
{
let
pulseView
:
MaterialPulseView
=
MaterialPulseView
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
pulseView
.
image
=
UIImage
(
named
:
"FocusAppIcon"
)
pulseView
.
shape
=
.
Square
pulseView
.
depth
=
.
Depth2
pulseView
.
cornerRadius
=
.
Radius3
// Add materialView to UIViewController.
view
.
addSubview
(
pulseView
)
pulseView
.
animate
(
MaterialAnimation
.
rotate
(
3
,
duration
:
3
))
UIView
.
animateWithDuration
(
0.4
,
delay
:
3
,
usingSpringWithDamping
:
0.6
,
initialSpringVelocity
:
0
,
options
:
.
AllowUserInteraction
,
animations
:
{
pulseView
.
frame
.
origin
.
x
=
300
},
completion
:
nil
)
}
}
}
Examples/Programmatic/MaterialView/MaterialView/ViewController.swift
View file @
80b03f9c
...
@@ -42,7 +42,8 @@ class ViewController: UIViewController {
...
@@ -42,7 +42,8 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
prepareGeneralMaterialViewExample
()
// prepareGeneralMaterialViewExample()
prepareMaterialViewAnimationExample
()
}
}
/// General preparation statements.
/// General preparation statements.
...
@@ -61,5 +62,26 @@ class ViewController: UIViewController {
...
@@ -61,5 +62,26 @@ class ViewController: UIViewController {
// Add materialView to UIViewController.
// Add materialView to UIViewController.
view
.
addSubview
(
materialView
)
view
.
addSubview
(
materialView
)
}
}
/// Prepares the MaterialView animation example.
private
func
prepareMaterialViewAnimationExample
()
{
let
materialView
:
MaterialView
=
MaterialView
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
materialView
.
image
=
UIImage
(
named
:
"FocusAppIcon"
)
materialView
.
shape
=
.
Square
materialView
.
depth
=
.
Depth2
materialView
.
cornerRadius
=
.
Radius3
// Add materialView to UIViewController.
view
.
addSubview
(
materialView
)
UIView
.
animateWithDuration
(
0.4
,
delay
:
3
,
usingSpringWithDamping
:
0.6
,
initialSpringVelocity
:
0
,
options
:
.
AllowUserInteraction
,
animations
:
{
materialView
.
frame
.
origin
.
x
=
300
},
completion
:
nil
)
}
}
}
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