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
753f218d
Commit
753f218d
authored
Oct 05, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added MaterialTransitionAnimation to MaterialAnimation
parent
50ed08b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
0 deletions
+93
-0
MaterialKit.xcodeproj/project.pbxproj
+4
-0
README.md
+1
-0
Source/MaterialTransitionAnimation.swift
+86
-0
Source/MaterialView.swift
+2
-0
No files found.
MaterialKit.xcodeproj/project.pbxproj
View file @
753f218d
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
964B17D51BBB31C2002A9CA0
/* MaterialAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65BDD1731BB8D443006F7F2B
/* MaterialAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
964B17D51BBB31C2002A9CA0
/* MaterialAnimation.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65BDD1731BB8D443006F7F2B
/* MaterialAnimation.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
964B17D61BBB31C2002A9CA0
/* MaterialLayout.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
964B17B31BBA447F002A9CA0
/* MaterialLayout.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
964B17D61BBB31C2002A9CA0
/* MaterialLayout.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
964B17B31BBA447F002A9CA0
/* MaterialLayout.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
964B17D91BBB3911002A9CA0
/* BasicCardView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
964B17D81BBB3911002A9CA0
/* BasicCardView.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
964B17D91BBB3911002A9CA0
/* BasicCardView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
964B17D81BBB3911002A9CA0
/* BasicCardView.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
96C4FABE1BC3168900E4FFC3
/* MaterialTransitionAnimation.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96C4FABD1BC3168900E4FFC3
/* MaterialTransitionAnimation.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
96D26BFD1BC23649006478BD
/* ImageCardView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D26BFC1BC23649006478BD
/* ImageCardView.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
96D26BFD1BC23649006478BD
/* ImageCardView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96D26BFC1BC23649006478BD
/* ImageCardView.swift */
;
settings
=
{
ASSET_TAGS
=
();
};
};
9A94D0FA1B895EA500F586A5
/* LICENSE in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832631B88E5BF0015F710
/* LICENSE */
;
};
9A94D0FA1B895EA500F586A5
/* LICENSE in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832631B88E5BF0015F710
/* LICENSE */
;
};
9A94D0FB1B895EA500F586A5
/* Roboto-Regular.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38591B8956E300FE6B2D
/* Roboto-Regular.ttf */
;
};
9A94D0FB1B895EA500F586A5
/* Roboto-Regular.ttf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38591B8956E300FE6B2D
/* Roboto-Regular.ttf */
;
};
...
@@ -109,6 +110,7 @@
...
@@ -109,6 +110,7 @@
964B17B31BBA447F002A9CA0
/* MaterialLayout.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialLayout.swift
;
sourceTree
=
"<group>"
;
};
964B17B31BBA447F002A9CA0
/* MaterialLayout.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialLayout.swift
;
sourceTree
=
"<group>"
;
};
964B17B51BBA4BEA002A9CA0
/* MaterialStatusBarStyle.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialStatusBarStyle.swift
;
sourceTree
=
"<group>"
;
};
964B17B51BBA4BEA002A9CA0
/* MaterialStatusBarStyle.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialStatusBarStyle.swift
;
sourceTree
=
"<group>"
;
};
964B17D81BBB3911002A9CA0
/* BasicCardView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
BasicCardView.swift
;
sourceTree
=
"<group>"
;
};
964B17D81BBB3911002A9CA0
/* BasicCardView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
BasicCardView.swift
;
sourceTree
=
"<group>"
;
};
96C4FABD1BC3168900E4FFC3
/* MaterialTransitionAnimation.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MaterialTransitionAnimation.swift
;
sourceTree
=
"<group>"
;
};
96D26BFC1BC23649006478BD
/* ImageCardView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageCardView.swift
;
sourceTree
=
"<group>"
;
};
96D26BFC1BC23649006478BD
/* ImageCardView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ImageCardView.swift
;
sourceTree
=
"<group>"
;
};
9AAC38551B8956C500FE6B2D
/* Roboto-Light.ttf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"Roboto-Light.ttf"
;
sourceTree
=
"<group>"
;
};
9AAC38551B8956C500FE6B2D
/* Roboto-Light.ttf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"Roboto-Light.ttf"
;
sourceTree
=
"<group>"
;
};
9AAC38571B8956CF00FE6B2D
/* Roboto-Medium.ttf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"Roboto-Medium.ttf"
;
sourceTree
=
"<group>"
;
};
9AAC38571B8956CF00FE6B2D
/* Roboto-Medium.ttf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"Roboto-Medium.ttf"
;
sourceTree
=
"<group>"
;
};
...
@@ -197,6 +199,7 @@
...
@@ -197,6 +199,7 @@
65BDD1731BB8D443006F7F2B
/* MaterialAnimation.swift */
,
65BDD1731BB8D443006F7F2B
/* MaterialAnimation.swift */
,
65D2BEC61BBED1E400800B7B
/* MaterialBasicAnimation.swift */
,
65D2BEC61BBED1E400800B7B
/* MaterialBasicAnimation.swift */
,
65D2BEC81BBED1FA00800B7B
/* MaterialKeyframeAnimation.swift */
,
65D2BEC81BBED1FA00800B7B
/* MaterialKeyframeAnimation.swift */
,
96C4FABD1BC3168900E4FFC3
/* MaterialTransitionAnimation.swift */
,
);
);
name
=
Animation
;
name
=
Animation
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -464,6 +467,7 @@
...
@@ -464,6 +467,7 @@
65BDD15B1BB7095E006F7F2B
/* MaterialRadius.swift in Sources */
,
65BDD15B1BB7095E006F7F2B
/* MaterialRadius.swift in Sources */
,
65BDD1721BB8CD77006F7F2B
/* MaterialLabel.swift in Sources */
,
65BDD1721BB8CD77006F7F2B
/* MaterialLabel.swift in Sources */
,
65BDD1491BB5DC98006F7F2B
/* MaterialColor.swift in Sources */
,
65BDD1491BB5DC98006F7F2B
/* MaterialColor.swift in Sources */
,
96C4FABE1BC3168900E4FFC3
/* MaterialTransitionAnimation.swift in Sources */
,
65D2BEC91BBED1FA00800B7B
/* MaterialKeyframeAnimation.swift in Sources */
,
65D2BEC91BBED1FA00800B7B
/* MaterialKeyframeAnimation.swift in Sources */
,
65D2BEC71BBED1E400800B7B
/* MaterialBasicAnimation.swift in Sources */
,
65D2BEC71BBED1E400800B7B
/* MaterialBasicAnimation.swift in Sources */
,
65BDD14D1BB5ED9F006F7F2B
/* MaterialTheme.swift in Sources */
,
65BDD14D1BB5ED9F006F7F2B
/* MaterialTheme.swift in Sources */
,
...
...
README.md
View file @
753f218d
...
@@ -275,6 +275,7 @@ Animations are a wonderful way to add life to your application. MaterialAnimatio
...
@@ -275,6 +275,7 @@ Animations are a wonderful way to add life to your application. MaterialAnimatio
```
swift
```
swift
let
v
:
MaterialPulseView
=
MaterialPulseView
(
frame
:
CGRectMake
(
50
,
50
,
200
,
200
))
let
v
:
MaterialPulseView
=
MaterialPulseView
(
frame
:
CGRectMake
(
50
,
50
,
200
,
200
))
v
.
spotlight
=
true
v
.
shape
=
.
Circle
v
.
shape
=
.
Circle
v
.
shadowDepth
=
.
Depth2
v
.
shadowDepth
=
.
Depth2
v
.
borderWidth
=
.
Border1
v
.
borderWidth
=
.
Border1
...
...
Source/MaterialTransitionAnimation.swift
0 → 100644
View file @
753f218d
//
// Copyright (C) 2015 GraphKit, Inc. <http://graphkit.io> and other GraphKit contributors.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program located at the root of the software package
// in a file called LICENSE. If not, see <http://www.gnu.org/licenses/>.
//
import
UIKit
public
typealias
MaterialAnimationTransitionType
=
String
public
typealias
MaterialAnimationTransitionSubTypeType
=
String
public
enum
MaterialAnimationTransition
{
case
Fade
case
MoveIn
case
Push
case
Reveal
}
public
enum
MaterialAnimationTransitionSubType
{
case
Right
case
Left
case
Top
case
Bottom
}
/**
:name: MaterialAnimationTransitionToValue
*/
public
func
MaterialAnimationTransitionToValue
(
transition
:
MaterialAnimationTransition
)
->
MaterialAnimationTransitionType
{
switch
transition
{
case
.
Fade
:
return
kCATransitionFade
case
.
MoveIn
:
return
kCATransitionMoveIn
case
.
Push
:
return
kCATransitionPush
case
.
Reveal
:
return
kCATransitionReveal
}
}
/**
:name: MaterialAnimationTransitionSubTypeToValue
*/
public
func
MaterialAnimationTransitionSubTypeToValue
(
direction
:
MaterialAnimationTransitionSubType
)
->
MaterialAnimationTransitionSubTypeType
{
switch
direction
{
case
.
Right
:
return
kCATransitionFromRight
case
.
Left
:
return
kCATransitionFromLeft
case
.
Top
:
return
kCATransitionFromTop
case
.
Bottom
:
return
kCATransitionFromBottom
}
}
public
extension
MaterialAnimation
{
/**
:name: transition
*/
public
static
func
transition
(
type
:
MaterialAnimationTransition
,
subtype
:
MaterialAnimationTransitionSubType
?
=
nil
,
duration
:
CFTimeInterval
?
=
nil
)
->
CATransition
{
let
animation
:
CATransition
=
CATransition
()
animation
.
type
=
MaterialAnimationTransitionToValue
(
type
)
if
let
s
=
subtype
{
animation
.
subtype
=
MaterialAnimationTransitionSubTypeToValue
(
s
)
}
if
let
d
=
duration
{
animation
.
duration
=
d
}
return
animation
}
}
\ No newline at end of file
Source/MaterialView.swift
View file @
753f218d
...
@@ -336,6 +336,8 @@ public class MaterialView : UIView {
...
@@ -336,6 +336,8 @@ public class MaterialView : UIView {
layer
.
addAnimation
(
a
,
forKey
:
nil
)
layer
.
addAnimation
(
a
,
forKey
:
nil
)
filterAnimations
(
a
)
filterAnimations
(
a
)
visualLayer
.
addAnimation
(
a
,
forKey
:
nil
)
visualLayer
.
addAnimation
(
a
,
forKey
:
nil
)
}
else
if
let
a
:
CATransition
=
animation
as?
CATransition
{
layer
.
addAnimation
(
a
,
forKey
:
kCATransition
)
}
}
}
}
...
...
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