Commit bdd87452 by Daniel Dahan

updated shadowDepth property to depth

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