Commit 1fc64c08 by Daniel Dahan

added flag for auto shadowPath sizing

parent 503d3ba7
......@@ -7,6 +7,8 @@
objects = {
/* 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 */; };
9663F9341C7A744600AF0965 /* SearchListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* SearchListViewController.swift */; };
9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; };
......@@ -27,6 +29,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
9656262E1C836CAA004ADEF7 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -34,6 +37,7 @@
/* End PBXCopyFilesBuildPhase 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; };
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>"; };
......@@ -54,6 +58,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9656262D1C836CAA004ADEF7 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -63,6 +68,7 @@
9663F9251C7A744500AF0965 = {
isa = PBXGroup;
children = (
9656262C1C836CAA004ADEF7 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */,
);
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.34.9'
s.version = '1.34.10'
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.homepage = 'http://cosmicmind.io'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.34.9</string>
<string>1.34.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -453,12 +466,14 @@ public class MaterialButton : UIButton {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -507,12 +520,14 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -331,12 +334,14 @@ public class MaterialLayer : CAShapeLayer {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
shadowPath = nil
} else if nil == shadowPath {
shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
shadowPath = nil
} else if nil == shadowPath {
shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
}
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -406,12 +419,14 @@ public class MaterialTableViewCell: UITableViewCell {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -446,12 +459,14 @@ public class MaterialView : UIView {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
}
......@@ -775,6 +775,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
leftView = MaterialView()
leftView!.frame = CGRectMake(0, 0, leftViewWidth, view.frame.height)
leftView!.backgroundColor = MaterialColor.clear
leftView!.shadowPathAutoSizeEnabled = true
view.addSubview(leftView!)
leftView!.hidden = true
......@@ -791,6 +792,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
rightView = MaterialView()
rightView!.frame = CGRectMake(0, 0, rightViewWidth, view.frame.height)
rightView!.backgroundColor = MaterialColor.clear
rightView!.shadowPathAutoSizeEnabled = true
view.addSubview(rightView!)
rightView!.hidden = true
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -555,12 +568,14 @@ public class TextField : UITextField {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
}
}
}
......
......@@ -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
for the backing layer. This is the preferred method of setting depth
......@@ -470,12 +483,14 @@ public class TextView: UITextView {
/// Sets the shadow path.
internal func layoutShadowPath() {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} else {
animate(MaterialAnimation.shadowPath(UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath, duration: 0))
if shadowPathAutoSizeEnabled {
if .None == self.depth {
layer.shadowPath = nil
} else if nil == layer.shadowPath {
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: cornerRadius).CGPath
} 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