Commit a45f4e2e by Daniel Dahan

update card pulseColor to allow for optional pulse

parent 14ba8863
...@@ -133,7 +133,7 @@ public class MaterialButton : UIButton { ...@@ -133,7 +133,7 @@ public class MaterialButton : UIButton {
pulseView = UIView(frame: CGRectMake(0, 0, bounds.height, bounds.height)) pulseView = UIView(frame: CGRectMake(0, 0, bounds.height, bounds.height))
pulseView!.layer.cornerRadius = bounds.height / 2 pulseView!.layer.cornerRadius = bounds.height / 2
pulseView!.center = (touches.first as! UITouch).locationInView(self) pulseView!.center = (touches.first as! UITouch).locationInView(self)
pulseView!.backgroundColor = pulseColor?.colorWithAlphaComponent(0.5) pulseView!.backgroundColor = pulseColor?.colorWithAlphaComponent(0.3)
backgroundColorView.addSubview(pulseView!) backgroundColorView.addSubview(pulseView!)
} }
......
...@@ -49,7 +49,7 @@ public class MaterialCardView : UIView { ...@@ -49,7 +49,7 @@ public class MaterialCardView : UIView {
/** /**
:name: pulseColor :name: pulseColor
*/ */
public var pulseColor: UIColor = MaterialTheme.blueGrey.lighten3 public var pulseColor: UIColor? = MaterialTheme.blueGrey.lighten3
/** /**
:name: init :name: init
...@@ -151,7 +151,7 @@ public class MaterialCardView : UIView { ...@@ -151,7 +151,7 @@ public class MaterialCardView : UIView {
pulseView = UIView(frame: CGRectMake(0, 0, width, width)) pulseView = UIView(frame: CGRectMake(0, 0, width, width))
pulseView!.layer.cornerRadius = width / 2 pulseView!.layer.cornerRadius = width / 2
pulseView!.center = (touches.first as! UITouch).locationInView(self) pulseView!.center = (touches.first as! UITouch).locationInView(self)
pulseView!.backgroundColor = pulseColor.colorWithAlphaComponent(0.3) pulseView!.backgroundColor = pulseColor?.colorWithAlphaComponent(0.3)
addSubview(pulseViewContainer) addSubview(pulseViewContainer)
Layout.expandToParent(self, child: pulseViewContainer) Layout.expandToParent(self, child: pulseViewContainer)
pulseViewContainer.addSubview(pulseView!) pulseViewContainer.addSubview(pulseView!)
......
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