Commit 3c9a67d4 by Daniel Dahan

added shadow depth

parent 507affe6
...@@ -38,7 +38,7 @@ public class FlatButton : MaterialButton { ...@@ -38,7 +38,7 @@ public class FlatButton : MaterialButton {
// //
internal override func prepareLayer() { internal override func prepareLayer() {
super.prepareLayer() super.prepareLayer()
shadow = MaterialTheme.button.flat.shadow shadowDepth = MaterialTheme.button.flat.shadowDepth
shadowColor = MaterialTheme.button.flat.shadowColor shadowColor = MaterialTheme.button.flat.shadowColor
zPosition = MaterialTheme.button.flat.zPosition zPosition = MaterialTheme.button.flat.zPosition
masksToBounds = MaterialTheme.button.flat.masksToBounds masksToBounds = MaterialTheme.button.flat.masksToBounds
......
...@@ -145,11 +145,11 @@ public class MaterialButton : UIButton { ...@@ -145,11 +145,11 @@ public class MaterialButton : UIButton {
} }
/** /**
:name: shadow :name: shadowDepth
*/ */
public var shadow: MaterialShadow! { public var shadowDepth: MaterialShadow! {
didSet { didSet {
let value: MaterialShadowType = MaterialShadowToValue(shadow) let value: MaterialShadowType = MaterialShadowToValue(shadowDepth)
shadowOffset = value.offset shadowOffset = value.offset
shadowOpacity = value.opacity shadowOpacity = value.opacity
shadowRadius = value.radius shadowRadius = value.radius
......
...@@ -37,7 +37,7 @@ public extension MaterialTheme.view { ...@@ -37,7 +37,7 @@ public extension MaterialTheme.view {
public static let height: CGFloat = UIScreen.mainScreen().bounds.height public static let height: CGFloat = UIScreen.mainScreen().bounds.height
// shadow // shadow
public static let shadow: MaterialShadow = .Depth0 public static let shadowDepth: MaterialShadow = .Depth0
public static let shadowColor: UIColor = MaterialColor.blueGrey.darken4 public static let shadowColor: UIColor = MaterialColor.blueGrey.darken4
// shape // shape
...@@ -73,7 +73,7 @@ public extension MaterialTheme.navigation { ...@@ -73,7 +73,7 @@ public extension MaterialTheme.navigation {
public static let height: CGFloat = 70 public static let height: CGFloat = 70
// shadow // shadow
public static let shadow: MaterialShadow = .Depth1 public static let shadowDepth: MaterialShadow = .Depth1
public static let shadowColor: UIColor = MaterialTheme.view.shadowColor public static let shadowColor: UIColor = MaterialTheme.view.shadowColor
// shape // shape
...@@ -104,7 +104,7 @@ public extension MaterialTheme.navigation { ...@@ -104,7 +104,7 @@ public extension MaterialTheme.navigation {
// button // button
public extension MaterialTheme.button { public extension MaterialTheme.button {
// shadow // shadow
public static let shadow: MaterialShadow = .Depth0 public static let shadowDepth: MaterialShadow = .Depth0
public static let shadowColor: UIColor = MaterialTheme.view.shadowColor public static let shadowColor: UIColor = MaterialTheme.view.shadowColor
// shape // shape
...@@ -133,7 +133,7 @@ public extension MaterialTheme.button { ...@@ -133,7 +133,7 @@ public extension MaterialTheme.button {
// button.flat // button.flat
public extension MaterialTheme.button.flat { public extension MaterialTheme.button.flat {
// shadow // shadow
public static let shadow: MaterialShadow = MaterialTheme.button.shadow public static let shadowDepth: MaterialShadow = MaterialTheme.button.shadowDepth
public static let shadowColor: UIColor = MaterialTheme.button.shadowColor public static let shadowColor: UIColor = MaterialTheme.button.shadowColor
// shape // shape
......
...@@ -190,11 +190,11 @@ public class MaterialView: UIView { ...@@ -190,11 +190,11 @@ public class MaterialView: UIView {
} }
/** /**
:name: shadow :name: shadowDepth
*/ */
public var shadow: MaterialShadow! { public var shadowDepth: MaterialShadow! {
didSet { didSet {
let value: MaterialShadowType = MaterialShadowToValue(shadow) let value: MaterialShadowType = MaterialShadowToValue(shadowDepth)
shadowOffset = value.offset shadowOffset = value.offset
shadowOpacity = value.opacity shadowOpacity = value.opacity
shadowRadius = value.radius shadowRadius = value.radius
...@@ -260,7 +260,7 @@ public class MaterialView: UIView { ...@@ -260,7 +260,7 @@ public class MaterialView: UIView {
contentsCenter = MaterialTheme.view.contentsCenter contentsCenter = MaterialTheme.view.contentsCenter
contentsScale = MaterialTheme.view.contentsScale contentsScale = MaterialTheme.view.contentsScale
contentsGravity = MaterialTheme.view.contentsGravity contentsGravity = MaterialTheme.view.contentsGravity
shadow = MaterialTheme.view.shadow shadowDepth = MaterialTheme.view.shadowDepth
shadowColor = MaterialTheme.view.shadowColor shadowColor = MaterialTheme.view.shadowColor
zPosition = MaterialTheme.view.zPosition zPosition = MaterialTheme.view.zPosition
masksToBounds = MaterialTheme.view.masksToBounds masksToBounds = MaterialTheme.view.masksToBounds
......
...@@ -54,7 +54,7 @@ public class NavigationBarView: MaterialView { ...@@ -54,7 +54,7 @@ public class NavigationBarView: MaterialView {
contentsCenter = MaterialTheme.navigation.contentsCenter contentsCenter = MaterialTheme.navigation.contentsCenter
contentsScale = MaterialTheme.navigation.contentsScale contentsScale = MaterialTheme.navigation.contentsScale
contentsGravity = MaterialTheme.navigation.contentsGravity contentsGravity = MaterialTheme.navigation.contentsGravity
shadow = MaterialTheme.navigation.shadow shadowDepth = MaterialTheme.navigation.shadowDepth
shadowColor = MaterialTheme.navigation.shadowColor shadowColor = MaterialTheme.navigation.shadowColor
zPosition = MaterialTheme.navigation.zPosition zPosition = MaterialTheme.navigation.zPosition
masksToBounds = MaterialTheme.navigation.masksToBounds masksToBounds = MaterialTheme.navigation.masksToBounds
......
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