Commit 7eb6d70c by Daniel Dahan

updated pulse animation durations

parent f5ceb503
......@@ -7,8 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
968F17241C94B5AD008CA3F6 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F17231C94B5AD008CA3F6 /* Material.framework */; };
968F17251C94B5AD008CA3F6 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 968F17231C94B5AD008CA3F6 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96DB1C5F1C14AA2800825BE6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96DB1C5E1C14AA2800825BE6 /* AppDelegate.swift */; };
96DB1C611C14AA2800825BE6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96DB1C601C14AA2800825BE6 /* ViewController.swift */; };
96DB1C661C14AA2800825BE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96DB1C651C14AA2800825BE6 /* Assets.xcassets */; };
......@@ -22,7 +20,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
968F17251C94B5AD008CA3F6 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -30,7 +27,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
968F17231C94B5AD008CA3F6 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
96DB1C5B1C14AA2800825BE6 /* MaterialPulseView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MaterialPulseView.app; sourceTree = BUILT_PRODUCTS_DIR; };
96DB1C5E1C14AA2800825BE6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96DB1C601C14AA2800825BE6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
......@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
968F17241C94B5AD008CA3F6 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -54,7 +49,6 @@
96DB1C521C14AA2800825BE6 = {
isa = PBXGroup;
children = (
968F17231C94B5AD008CA3F6 /* Material.framework */,
96DB1C5D1C14AA2800825BE6 /* MaterialPulseView */,
96DB1C5C1C14AA2800825BE6 /* Products */,
);
......
......@@ -59,21 +59,21 @@ class ViewController: UIViewController {
pulseView.shape = .Square
pulseView.depth = .Depth1
pulseView.cornerRadiusPreset = .Radius3
pulseView.pulseFocus = true
// pulseView.pulseFocus = true // Optional focus animation.
// Add pulseView to UIViewController.
view.addSubview(pulseView)
// // Trigger the pulse animation.
// Trigger the pulse animation.
// MaterialAnimation.delay(4) {
// pulseView.pulse(CGPointMake(30, 30))
// }
//
// pulseView.animate(MaterialAnimation.animationGroup([
// MaterialAnimation.rotate(rotation: 0.5),
// MaterialAnimation.rotateX(rotation: 2),
// MaterialAnimation.translateY(200)
// ], duration: 4))
pulseView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 0.5),
MaterialAnimation.rotateX(rotation: 2),
MaterialAnimation.translateY(200)
], duration: 4))
}
}
......@@ -68,7 +68,7 @@ internal extension MaterialAnimation {
pulseLayer!.hidden = false
}
pulseLayer!.addAnimation(MaterialAnimation.scale(3 * d, duration: duration), forKey: nil)
pulseLayer!.addAnimation(MaterialAnimation.scale((b ? 3 : 1.7) * d, duration: duration), forKey: nil)
if b {
MaterialAnimation.delay(duration) {
......@@ -80,7 +80,7 @@ internal extension MaterialAnimation {
}
} else {
MaterialAnimation.delay(duration / 2) {
pulseLayer?.addAnimation(MaterialAnimation.scale(1.10 * d, duration: duration), forKey: nil)
pulseLayer?.addAnimation(MaterialAnimation.scale(1.3 * d, duration: duration), forKey: nil)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment