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
371f183a
Unverified
Commit
371f183a
authored
Dec 16, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: issue-194: fixed issue where hit test was failing after tranlation animation
parent
aa90c37b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
4 deletions
+40
-4
Sources/iOS/Material+CALayer.swift
+36
-0
Sources/iOS/MotionPulse.swift
+4
-4
No files found.
Sources/iOS/Material+CALayer.swift
View file @
371f183a
...
@@ -254,6 +254,8 @@ extension CALayer {
...
@@ -254,6 +254,8 @@ extension CALayer {
- Parameter animation: A CAAnimation instance.
- Parameter animation: A CAAnimation instance.
*/
*/
open
func
animate
(
animation
:
CAAnimation
)
{
open
func
animate
(
animation
:
CAAnimation
)
{
animation
.
delegate
=
self
if
let
a
=
animation
as?
CABasicAnimation
{
if
let
a
=
animation
as?
CABasicAnimation
{
a
.
fromValue
=
(
presentation
()
??
self
)
.
value
(
forKeyPath
:
a
.
keyPath
!
)
a
.
fromValue
=
(
presentation
()
??
self
)
.
value
(
forKeyPath
:
a
.
keyPath
!
)
}
}
...
@@ -267,6 +269,40 @@ extension CALayer {
...
@@ -267,6 +269,40 @@ extension CALayer {
}
}
}
}
/**
A delegation method that is executed when the backing layer stops
running an animation.
- Parameter animation: The CAAnimation instance that stopped running.
- Parameter flag: A boolean that indicates if the animation stopped
because it was completed or interrupted. True if completed, false
if interrupted.
*/
open
func
animationDidStop
(
_
animation
:
CAAnimation
,
finished
flag
:
Bool
)
{
guard
let
a
=
animation
as?
CAPropertyAnimation
else
{
if
let
a
=
(
animation
as?
CAAnimationGroup
)?
.
animations
{
for
x
in
a
{
animationDidStop
(
x
,
finished
:
true
)
}
}
return
}
guard
let
b
=
a
as?
CABasicAnimation
else
{
return
}
guard
let
v
=
b
.
toValue
else
{
return
}
guard
let
k
=
b
.
keyPath
else
{
return
}
setValue
(
v
,
forKeyPath
:
k
)
removeAnimation
(
forKey
:
k
)
}
/// Manages the layout for the shape of the view instance.
/// Manages the layout for the shape of the view instance.
open
func
layoutShape
()
{
open
func
layoutShape
()
{
guard
.
none
!=
shapePreset
else
{
guard
.
none
!=
shapePreset
else
{
...
...
Sources/iOS/MotionPulse.swift
View file @
371f183a
...
@@ -111,18 +111,18 @@ public struct Pulse {
...
@@ -111,18 +111,18 @@ public struct Pulse {
layer
.
masksToBounds
=
!
(
.
centerRadialBeyondBounds
==
animation
||
.
radialBeyondBounds
==
animation
)
layer
.
masksToBounds
=
!
(
.
centerRadialBeyondBounds
==
animation
||
.
radialBeyondBounds
==
animation
)
let
w
=
view
.
width
let
w
=
view
.
bounds
.
width
let
h
=
view
.
height
let
h
=
view
.
bounds
.
height
Motion
.
disable
(
animations
:
{
[
Motion
.
disable
(
animations
:
{
[
n
=
.
center
==
animation
?
w
<
h
?
w
:
h
:
w
<
h
?
h
:
w
,
n
=
.
center
==
animation
?
w
<
h
?
w
:
h
:
w
<
h
?
h
:
w
,
frame
=
layer
.
bounds
,
bounds
=
layer
.
bounds
,
animation
=
animation
,
animation
=
animation
,
color
=
color
,
color
=
color
,
opacity
=
opacity
opacity
=
opacity
]
in
]
in
bLayer
.
frame
=
frame
bLayer
.
frame
=
bounds
pLayer
.
bounds
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
n
,
height
:
n
)
pLayer
.
bounds
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
n
,
height
:
n
)
switch
animation
{
switch
animation
{
...
...
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