Commit 1fc64c08 by Daniel Dahan

added flag for auto shadowPath sizing

parent 503d3ba7
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
9656262D1C836CAA004ADEF7 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9656262C1C836CAA004ADEF7 /* Material.framework */; };
9656262E1C836CAA004ADEF7 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9656262C1C836CAA004ADEF7 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9663F9321C7A744600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9311C7A744600AF0965 /* AppDelegate.swift */; }; 9663F9321C7A744600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9311C7A744600AF0965 /* AppDelegate.swift */; };
9663F9341C7A744600AF0965 /* SearchListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* SearchListViewController.swift */; }; 9663F9341C7A744600AF0965 /* SearchListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* SearchListViewController.swift */; };
9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; }; 9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; };
...@@ -27,6 +29,7 @@ ...@@ -27,6 +29,7 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
9656262E1C836CAA004ADEF7 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -34,6 +37,7 @@ ...@@ -34,6 +37,7 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
9656262C1C836CAA004ADEF7 /* 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>"; };
9663F92E1C7A744600AF0965 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9663F92E1C7A744600AF0965 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
9663F9311C7A744600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 9663F9311C7A744600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9663F9331C7A744600AF0965 /* SearchListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchListViewController.swift; sourceTree = "<group>"; }; 9663F9331C7A744600AF0965 /* SearchListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchListViewController.swift; sourceTree = "<group>"; };
...@@ -54,6 +58,7 @@ ...@@ -54,6 +58,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9656262D1C836CAA004ADEF7 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -63,6 +68,7 @@ ...@@ -63,6 +68,7 @@
9663F9251C7A744500AF0965 = { 9663F9251C7A744500AF0965 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9656262C1C836CAA004ADEF7 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */, 9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */, 9663F92F1C7A744600AF0965 /* Products */,
); );
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.34.9' s.version = '1.34.10'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.34.9</string> <string>1.34.10</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -169,6 +169,19 @@ public class MaterialButton : UIButton { ...@@ -169,6 +169,19 @@ public class MaterialButton : UIButton {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -453,6 +466,7 @@ public class MaterialButton : UIButton { ...@@ -453,6 +466,7 @@ public class MaterialButton : UIButton {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -461,6 +475,7 @@ public class MaterialButton : UIButton { ...@@ -461,6 +475,7 @@ public class MaterialButton : UIButton {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
/** /**
Triggers the pulse animation. Triggers the pulse animation.
......
...@@ -224,6 +224,19 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -224,6 +224,19 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -507,6 +520,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -507,6 +520,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -515,6 +529,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -515,6 +529,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
/** /**
Triggers the pulse animation. Triggers the pulse animation.
......
...@@ -154,6 +154,9 @@ public class MaterialLayer : CAShapeLayer { ...@@ -154,6 +154,9 @@ public class MaterialLayer : CAShapeLayer {
} }
} }
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -331,6 +334,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -331,6 +334,7 @@ public class MaterialLayer : CAShapeLayer {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
shadowPath = nil shadowPath = nil
} else if nil == shadowPath { } else if nil == shadowPath {
...@@ -339,4 +343,5 @@ public class MaterialLayer : CAShapeLayer { ...@@ -339,4 +343,5 @@ public class MaterialLayer : CAShapeLayer {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
} }
...@@ -162,6 +162,19 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -162,6 +162,19 @@ public class MaterialTableViewCell: UITableViewCell {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -406,6 +419,7 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -406,6 +419,7 @@ public class MaterialTableViewCell: UITableViewCell {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -414,6 +428,7 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -414,6 +428,7 @@ public class MaterialTableViewCell: UITableViewCell {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
/** /**
Triggers the pulse animation. Triggers the pulse animation.
......
...@@ -212,6 +212,19 @@ public class MaterialView : UIView { ...@@ -212,6 +212,19 @@ public class MaterialView : UIView {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -446,6 +459,7 @@ public class MaterialView : UIView { ...@@ -446,6 +459,7 @@ public class MaterialView : UIView {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -454,4 +468,5 @@ public class MaterialView : UIView { ...@@ -454,4 +468,5 @@ public class MaterialView : UIView {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
} }
...@@ -775,6 +775,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -775,6 +775,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
leftView = MaterialView() leftView = MaterialView()
leftView!.frame = CGRectMake(0, 0, leftViewWidth, view.frame.height) leftView!.frame = CGRectMake(0, 0, leftViewWidth, view.frame.height)
leftView!.backgroundColor = MaterialColor.clear leftView!.backgroundColor = MaterialColor.clear
leftView!.shadowPathAutoSizeEnabled = true
view.addSubview(leftView!) view.addSubview(leftView!)
leftView!.hidden = true leftView!.hidden = true
...@@ -791,6 +792,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -791,6 +792,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
rightView = MaterialView() rightView = MaterialView()
rightView!.frame = CGRectMake(0, 0, rightViewWidth, view.frame.height) rightView!.frame = CGRectMake(0, 0, rightViewWidth, view.frame.height)
rightView!.backgroundColor = MaterialColor.clear rightView!.backgroundColor = MaterialColor.clear
rightView!.shadowPathAutoSizeEnabled = true
view.addSubview(rightView!) view.addSubview(rightView!)
rightView!.hidden = true rightView!.hidden = true
......
...@@ -148,6 +148,19 @@ public class TextField : UITextField { ...@@ -148,6 +148,19 @@ public class TextField : UITextField {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -555,6 +568,7 @@ public class TextField : UITextField { ...@@ -555,6 +568,7 @@ public class TextField : UITextField {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -563,6 +577,7 @@ public class TextField : UITextField { ...@@ -563,6 +577,7 @@ public class TextField : UITextField {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
/// Prepares the titleLabel property. /// Prepares the titleLabel property.
private func prepareTitleLabel() { private func prepareTitleLabel() {
......
...@@ -150,6 +150,19 @@ public class TextView: UITextView { ...@@ -150,6 +150,19 @@ public class TextView: UITextView {
} }
} }
/// A property that accesses the backing layer's shadowPath.
public var shadowPath: CGPath? {
get {
return layer.shadowPath
}
set(value) {
layer.shadowPath = value
}
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = false
/** /**
A property that sets the shadowOffset, shadowOpacity, and shadowRadius A property that sets the shadowOffset, shadowOpacity, and shadowRadius
for the backing layer. This is the preferred method of setting depth for the backing layer. This is the preferred method of setting depth
...@@ -470,6 +483,7 @@ public class TextView: UITextView { ...@@ -470,6 +483,7 @@ public class TextView: UITextView {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled {
if .None == self.depth { if .None == self.depth {
layer.shadowPath = nil layer.shadowPath = nil
} else if nil == layer.shadowPath { } else if nil == layer.shadowPath {
...@@ -478,6 +492,7 @@ public class TextView: UITextView { ...@@ -478,6 +492,7 @@ public class TextView: UITextView {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
} }
} }
}
/** /**
Prepares the view instance when intialized. When subclassing, Prepares the view instance when intialized. When subclassing,
......
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