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,12 +466,14 @@ public class MaterialButton : UIButton { ...@@ -453,12 +466,14 @@ public class MaterialButton : UIButton {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
} }
} }
......
...@@ -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,12 +520,14 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -507,12 +520,14 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
} }
} }
......
...@@ -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,12 +334,14 @@ public class MaterialLayer : CAShapeLayer { ...@@ -331,12 +334,14 @@ public class MaterialLayer : CAShapeLayer {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
shadowPath = nil if .None == self.depth {
} else if nil == shadowPath { shadowPath = nil
shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == shadowPath {
} else { shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
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,12 +419,14 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -406,12 +419,14 @@ public class MaterialTableViewCell: UITableViewCell {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
} }
} }
......
...@@ -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,12 +459,14 @@ public class MaterialView : UIView { ...@@ -446,12 +459,14 @@ public class MaterialView : UIView {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
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,12 +568,14 @@ public class TextField : UITextField { ...@@ -555,12 +568,14 @@ public class TextField : UITextField {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
} }
} }
......
...@@ -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,12 +483,14 @@ public class TextView: UITextView { ...@@ -470,12 +483,14 @@ public class TextView: UITextView {
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if .None == self.depth { if shadowPathAutoSizeEnabled {
layer.shadowPath = nil if .None == self.depth {
} else if nil == layer.shadowPath { layer.shadowPath = nil
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath } else if nil == layer.shadowPath {
} else { layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0)) } else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
} }
} }
......
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