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
13bc2246
Commit
13bc2246
authored
Oct 11, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to MaterialAnimation interface
parent
2017544d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
Source/MaterialCollectionViewCell.swift
+9
-9
Source/MaterialTransitionAnimation.swift
+3
-3
Source/MaterialView.swift
+7
-0
No files found.
Source/MaterialCollectionViewCell.swift
View file @
13bc2246
...
...
@@ -20,8 +20,8 @@ import UIKit
@objc(MaterialCollectionViewCellDelegate)
public
protocol
MaterialCollectionViewCellDelegate
:
MaterialDelegate
{
optional
func
materialCollectionViewCellWill
Reveal
LeftLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellWill
Reveal
RightLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellWill
PassThresholdFor
LeftLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellWill
PassThresholdFor
RightLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellDidRevealLeftLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellDidRevealRightLayer
(
cell
:
MaterialCollectionViewCell
)
optional
func
materialCollectionViewCellDidCloseLeftLayer
(
cell
:
MaterialCollectionViewCell
)
...
...
@@ -68,7 +68,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell, UIGestureRecogni
/**
:name: delegate
*/
public
weak
var
delegate
:
MaterialDelegate
?
public
weak
var
delegate
:
Material
CollectionViewCell
Delegate
?
/**
:name: pulseScale
...
...
@@ -496,16 +496,16 @@ public class MaterialCollectionViewCell : UICollectionViewCell, UIGestureRecogni
if
!
revealed
&&
(
leftOnDragRelease
||
rightOnDragRelease
)
{
revealed
=
true
if
leftOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)?
.
materialCollectionViewCellWillReveal
LeftLayer
?(
self
)
delegate
?
.
materialCollectionViewCellWillPassThresholdFor
LeftLayer
?(
self
)
}
else
if
rightOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)?
.
materialCollectionViewCellWillReveal
RightLayer
?(
self
)
delegate
?
.
materialCollectionViewCellWillPassThresholdFor
RightLayer
?(
self
)
}
}
if
leftOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)
?
.
materialCollectionViewCellDidRevealLeftLayer
?(
self
)
delegate
?
.
materialCollectionViewCellDidRevealLeftLayer
?(
self
)
}
else
if
rightOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)
?
.
materialCollectionViewCellDidRevealRightLayer
?(
self
)
delegate
?
.
materialCollectionViewCellDidRevealRightLayer
?(
self
)
}
case
.
Ended
:
...
...
@@ -517,9 +517,9 @@ public class MaterialCollectionViewCell : UICollectionViewCell, UIGestureRecogni
animation
(
a
)
if
leftOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)
?
.
materialCollectionViewCellDidCloseLeftLayer
?(
self
)
delegate
?
.
materialCollectionViewCellDidCloseLeftLayer
?(
self
)
}
else
if
rightOnDragRelease
{
(
delegate
as?
MaterialCollectionViewCellDelegate
)
?
.
materialCollectionViewCellDidCloseRightLayer
?(
self
)
delegate
?
.
materialCollectionViewCellDidCloseRightLayer
?(
self
)
}
default
:
...
...
Source/MaterialTransitionAnimation.swift
View file @
13bc2246
...
...
@@ -71,11 +71,11 @@ public extension MaterialAnimation {
/**
:name: transition
*/
public
static
func
transition
(
type
:
MaterialAnimationTransition
,
subtype
:
MaterialAnimationTransitionSubType
?
=
nil
,
duration
:
CFTimeInterval
?
=
nil
)
->
CATransition
{
public
static
func
transition
(
type
:
MaterialAnimationTransition
,
direction
:
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
=
direction
{
animation
.
subtype
=
MaterialAnimationTransitionSubTypeToValue
(
d
)
}
if
let
d
=
duration
{
animation
.
duration
=
d
...
...
Source/MaterialView.swift
View file @
13bc2246
...
...
@@ -327,6 +327,13 @@ public class MaterialView : UIView {
}
/**
:name: actionForLayer
*/
public
override
func
actionForLayer
(
layer
:
CALayer
,
forKey
event
:
String
)
->
CAAction
?
{
return
nil
}
/**
:name: animation
*/
public
func
animation
(
animation
:
CAAnimation
)
{
...
...
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