Commit bdd87452 by Daniel Dahan

updated shadowDepth property to depth

parent 65c7a1e6
......@@ -229,7 +229,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
*/
private func prepareNavigationBarView() {
navigationBarView.backgroundColor = nil
navigationBarView.shadowDepth = .None
navigationBarView.depth = .None
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -270,7 +270,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
captureButton.backgroundColor = MaterialColor.red.darken1.colorWithAlphaComponent(0.3)
captureButton.borderWidth = .Border2
captureButton.borderColor = MaterialColor.white
captureButton.shadowDepth = .None
captureButton.depth = .None
captureView.captureButton = captureButton
}
......
......@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let materialLayer: MaterialLayer = MaterialLayer(frame: CGRectMake(132, 132, 150, 150))
materialLayer.image = UIImage(named: "CosmicMindAppIcon")
materialLayer.shape = .Circle
materialLayer.shadowDepth = .Depth2
materialLayer.depth = .Depth2
// Add layer to UIViewController.
view.layer.addSublayer(materialLayer)
......
......@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let pulseView: MaterialPulseView = MaterialPulseView(frame: CGRectMake(132, 132, 150, 150))
pulseView.image = UIImage(named: "ContentAppIcon")
pulseView.shape = .Circle
pulseView.shadowDepth = .Depth2
pulseView.depth = .Depth2
// Add view to UIViewController.
view.addSubview(pulseView)
......
......@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let materialView: MaterialView = MaterialView(frame: CGRectMake(132, 132, 150, 150))
materialView.image = UIImage(named: "FocusAppIcon")
materialView.shape = .Square
materialView.shadowDepth = .Depth2
materialView.depth = .Depth2
materialView.cornerRadius = .Radius3
// Add view to UIViewController.
......
......@@ -45,7 +45,7 @@ class ViewController: UIViewController {
private func prepareGeneralMaterialPulseViewExample() {
pulseView.image = UIImage(named: "ContentAppIcon")
pulseView.shape = .Circle
pulseView.shadowDepth = .Depth2
pulseView.depth = .Depth2
}
}
......@@ -315,7 +315,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
contentsCenter = MaterialTheme.captureView.contentsCenter
contentsScale = MaterialTheme.captureView.contentsScale
contentsGravity = MaterialTheme.captureView.contentsGravity
shadowDepth = MaterialTheme.captureView.shadowDepth
depth = MaterialTheme.captureView.depth
shadowColor = MaterialTheme.captureView.shadowColor
zPosition = MaterialTheme.captureView.zPosition
borderWidth = MaterialTheme.captureView.borderWidth
......
......@@ -402,7 +402,7 @@ public class CardView : MaterialPulseView {
contentsCenter = MaterialTheme.basicCardView.contentsCenter
contentsScale = MaterialTheme.basicCardView.contentsScale
contentsGravity = MaterialTheme.basicCardView.contentsGravity
shadowDepth = MaterialTheme.basicCardView.shadowDepth
depth = MaterialTheme.basicCardView.depth
shadowColor = MaterialTheme.basicCardView.shadowColor
zPosition = MaterialTheme.basicCardView.zPosition
borderWidth = MaterialTheme.basicCardView.borderWidth
......
......@@ -32,7 +32,7 @@ public class FabButton : MaterialButton {
pulseColorOpacity = MaterialTheme.fabButton.pulseColorOpacity
pulseColor = MaterialTheme.fabButton.pulseColor
shadowDepth = MaterialTheme.fabButton.shadowDepth
depth = MaterialTheme.fabButton.depth
shadowColor = MaterialTheme.fabButton.shadowColor
zPosition = MaterialTheme.fabButton.zPosition
borderWidth = MaterialTheme.fabButton.borderWidth
......
......@@ -32,7 +32,7 @@ public class FlatButton : MaterialButton {
pulseColorOpacity = MaterialTheme.flatButton.pulseColorOpacity
pulseColor = MaterialTheme.flatButton.pulseColor
shadowDepth = MaterialTheme.flatButton.shadowDepth
depth = MaterialTheme.flatButton.depth
shadowColor = MaterialTheme.flatButton.shadowColor
zPosition = MaterialTheme.flatButton.zPosition
cornerRadius = MaterialTheme.flatButton.cornerRadius
......
......@@ -539,7 +539,7 @@ public class ImageCardView : MaterialPulseView {
contentsCenter = MaterialTheme.imageCardView.contentsCenter
contentsScale = MaterialTheme.imageCardView.contentsScale
contentsGravity = MaterialTheme.imageCardView.contentsGravity
shadowDepth = MaterialTheme.imageCardView.shadowDepth
depth = MaterialTheme.imageCardView.depth
shadowColor = MaterialTheme.imageCardView.shadowColor
zPosition = MaterialTheme.imageCardView.zPosition
borderWidth = MaterialTheme.imageCardView.borderWidth
......
......@@ -201,11 +201,11 @@ public class MaterialButton : UIButton {
}
/**
:name: shadowDepth
:name: depth
*/
public var shadowDepth: MaterialDepth {
public var depth: MaterialDepth {
didSet {
let value: MaterialDepthType = MaterialDepthToValue(shadowDepth)
let value: MaterialDepthType = MaterialDepthToValue(depth)
shadowOffset = value.offset
shadowOpacity = value.opacity
shadowRadius = value.radius
......@@ -298,7 +298,7 @@ public class MaterialButton : UIButton {
*/
public required init?(coder aDecoder: NSCoder) {
borderWidth = .None
shadowDepth = .None
depth = .None
shape = .None
contentInsets = .None
super.init(coder: aDecoder)
......@@ -310,7 +310,7 @@ public class MaterialButton : UIButton {
*/
public override init(frame: CGRect) {
borderWidth = .None
shadowDepth = .None
depth = .None
shape = .None
contentInsets = .None
super.init(frame: frame)
......
......@@ -143,11 +143,11 @@ public class MaterialLayer : CAShapeLayer {
}
/**
:name: shadowDepth
:name: depth
*/
public var shadowDepth: MaterialDepth {
public var depth: MaterialDepth {
didSet {
let value: MaterialDepthType = MaterialDepthToValue(shadowDepth)
let value: MaterialDepthType = MaterialDepthToValue(depth)
shadowOffset = value.offset
shadowOpacity = value.opacity
shadowRadius = value.radius
......@@ -185,7 +185,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public required init?(coder aDecoder: NSCoder) {
shape = .None
shadowDepth = .None
depth = .None
super.init(coder: aDecoder)
prepareVisualLayer()
}
......@@ -195,7 +195,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public override init(layer: AnyObject) {
shape = .None
shadowDepth = .None
depth = .None
super.init()
prepareVisualLayer()
}
......@@ -205,7 +205,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public override init() {
shape = .None
shadowDepth = .None
depth = .None
super.init()
prepareVisualLayer()
}
......
......@@ -143,7 +143,7 @@ public class MaterialPulseView : MaterialView {
contentsCenter = MaterialTheme.pulseView.contentsCenter
contentsScale = MaterialTheme.pulseView.contentsScale
contentsGravity = MaterialTheme.pulseView.contentsGravity
shadowDepth = MaterialTheme.pulseView.shadowDepth
depth = MaterialTheme.pulseView.depth
shadowColor = MaterialTheme.pulseView.shadowColor
zPosition = MaterialTheme.pulseView.zPosition
borderWidth = MaterialTheme.pulseView.borderWidth
......
......@@ -35,7 +35,7 @@ public struct MaterialTheme {
// view
public extension MaterialTheme.view {
// shadow
public static var shadowDepth: MaterialDepth = .None
public static var depth: MaterialDepth = .None
public static var shadowColor: UIColor = MaterialColor.black
// border
......@@ -61,7 +61,7 @@ public extension MaterialTheme.view {
// pulseView
public extension MaterialTheme.pulseView {
// shadow
public static var shadowDepth: MaterialDepth = .None
public static var depth: MaterialDepth = .None
public static var shadowColor: UIColor = MaterialColor.black
// border
......@@ -89,7 +89,7 @@ public extension MaterialTheme.pulseView {
// basicCardView
public extension MaterialTheme.basicCardView {
// shadow
public static var shadowDepth: MaterialDepth = .Depth2
public static var depth: MaterialDepth = .Depth2
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -129,7 +129,7 @@ public extension MaterialTheme.basicCardView {
// imageCardView
public extension MaterialTheme.imageCardView {
// shadow
public static var shadowDepth: MaterialDepth = .Depth2
public static var depth: MaterialDepth = .Depth2
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -175,7 +175,7 @@ public extension MaterialTheme.navigationBarView {
public static var height: CGFloat = 70
// shadow
public static var shadowDepth: MaterialDepth = .Depth2
public static var depth: MaterialDepth = .Depth2
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -208,7 +208,7 @@ public extension MaterialTheme.navigationBarView {
// captureView
public extension MaterialTheme.captureView {
// shadow
public static var shadowDepth: MaterialDepth = .None
public static var depth: MaterialDepth = .None
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -267,7 +267,7 @@ public extension MaterialTheme.label {
// flatButton
public extension MaterialTheme.flatButton {
// shadow
public static var shadowDepth: MaterialDepth = .None
public static var depth: MaterialDepth = .None
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -298,7 +298,7 @@ public extension MaterialTheme.flatButton {
// raisedButton
public extension MaterialTheme.raisedButton {
// shadow
public static var shadowDepth: MaterialDepth = .Depth2
public static var depth: MaterialDepth = .Depth2
public static var shadowColor: UIColor = MaterialColor.black
// shape
......@@ -330,7 +330,7 @@ public extension MaterialTheme.raisedButton {
// fabButton
public extension MaterialTheme.fabButton {
// shadow
public static var shadowDepth: MaterialDepth = .Depth2
public static var depth: MaterialDepth = .Depth2
public static var shadowColor: UIColor = MaterialColor.black
// shape
......
......@@ -36,7 +36,7 @@ public class MaterialView : UIView {
/**
An optional property that sets an image to the visualLayer's
contents. Images should not be set to the backing layer's
contents property. Images should not be set to the backing layer's
contents property to avoid conflicts when using clipsToBounds.
*/
public var image: UIImage? {
......@@ -100,7 +100,7 @@ public class MaterialView : UIView {
}
}
/// An Optional value that set's the backing layer's backgroundColor.
/// An optional property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.CGColor
......@@ -163,18 +163,14 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowColor
*/
/// An optional property that accesses the backing layer's shadowColor.
public var shadowColor: UIColor? {
didSet {
layer.shadowColor = shadowColor?.CGColor
}
}
/**
:name: shadowOffset
*/
/// A property that accesses the backing layer's shadowOffset.
public var shadowOffset: CGSize {
get {
return layer.shadowOffset
......@@ -184,9 +180,7 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowOpacity
*/
/// A property that accesses the backing layer's shadowOpacity.
public var shadowOpacity: Float {
get {
return layer.shadowOpacity
......@@ -196,9 +190,7 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowRadius
*/
/// A property that accesses the backing layer's shadowRadius.
public var shadowRadius: CGFloat {
get {
return layer.shadowRadius
......@@ -209,11 +201,13 @@ public class MaterialView : UIView {
}
/**
:name: shadowDepth
A convenience property that sets the shadowOffset, shadowOpacity, and
shadowRadius for the backing layer. This is the preferred method of
setting depth in order to maintain consitency across UI objects.
*/
public var shadowDepth: MaterialDepth {
public var depth: MaterialDepth {
didSet {
let value: MaterialDepthType = MaterialDepthToValue(shadowDepth)
let value: MaterialDepthType = MaterialDepthToValue(depth)
shadowOffset = value.offset
shadowOpacity = value.opacity
shadowRadius = value.radius
......@@ -300,7 +294,7 @@ public class MaterialView : UIView {
contentsScale = MaterialTheme.view.contentsScale
contentsGravity = MaterialTheme.view.contentsGravity
borderWidth = MaterialTheme.view.borderWidth
shadowDepth = MaterialTheme.view.shadowDepth
depth = MaterialTheme.view.depth
shape = .None
cornerRadius = .None
super.init(coder: aDecoder)
......@@ -316,7 +310,7 @@ public class MaterialView : UIView {
contentsScale = MaterialTheme.view.contentsScale
contentsGravity = MaterialTheme.view.contentsGravity
borderWidth = MaterialTheme.view.borderWidth
shadowDepth = MaterialTheme.view.shadowDepth
depth = MaterialTheme.view.depth
shape = .None
cornerRadius = .None
super.init(frame: frame)
......
......@@ -327,7 +327,7 @@ public class NavigationBarView : MaterialView {
contentsCenter = MaterialTheme.navigationBarView.contentsCenter
contentsScale = MaterialTheme.navigationBarView.contentsScale
contentsGravity = MaterialTheme.navigationBarView.contentsGravity
shadowDepth = MaterialTheme.navigationBarView.shadowDepth
depth = MaterialTheme.navigationBarView.depth
shadowColor = MaterialTheme.navigationBarView.shadowColor
zPosition = MaterialTheme.navigationBarView.zPosition
borderWidth = MaterialTheme.navigationBarView.borderWidth
......
......@@ -32,7 +32,7 @@ public class RaisedButton : MaterialButton {
pulseColorOpacity = MaterialTheme.raisedButton.pulseColorOpacity
pulseColor = MaterialTheme.raisedButton.pulseColor
shadowDepth = MaterialTheme.raisedButton.shadowDepth
depth = MaterialTheme.raisedButton.depth
shadowColor = MaterialTheme.raisedButton.shadowColor
zPosition = MaterialTheme.raisedButton.zPosition
cornerRadius = MaterialTheme.raisedButton.cornerRadius
......
......@@ -137,18 +137,18 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public var enableShadowDepth: Bool = true {
didSet {
if !enableShadowDepth {
sideView.shadowDepth = .None
sideView.depth = .None
}
}
}
/**
:name: shadowDepth
:name: depth
*/
public var shadowDepth: MaterialDepth = .Depth2 {
public var depth: MaterialDepth = .Depth2 {
didSet {
if !enableShadowDepth && .None != sideView.shadowDepth {
sideView.shadowDepth = shadowDepth
if !enableShadowDepth && .None != sideView.depth {
sideView.depth = depth
}
}
}
......@@ -297,7 +297,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
if self.enableShadowDepth {
MaterialAnimation.animationDisabled { [unowned self, unowned sideView = self.sideView] in
sideView.shadowDepth = self.shadowDepth
sideView.depth = self.depth
}
}
......@@ -322,7 +322,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
if self.enableShadowDepth {
MaterialAnimation.animationDisabled { [unowned sideView = self.sideView] in
sideView.shadowDepth = .None
sideView.depth = .None
}
}
......@@ -399,7 +399,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
toggleStatusBar(true)
if enableShadowDepth {
MaterialAnimation.animationDisabled { [unowned self, sideView = self.sideView] in
sideView.shadowDepth = self.shadowDepth
sideView.depth = self.depth
}
}
delegate?.sideNavigationViewPanDidBegin?(self, point: sideView.position)
......
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