Commit 156f4984 by Daniel Dahan

progressive cleanup

parent 605728de
......@@ -49,13 +49,14 @@ public class FlatButton : MaterialButton {
let touchLocation = touch.locationInView(self)
pulseView = UIView()
pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
pulseView!.layer.cornerRadius = bounds.height / 2
pulseView!.layer.cornerRadius = bounds.height / 2.0
pulseView!.center = touchLocation
pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
backgroundColorView.addSubview(pulseView!)
textColor = self.titleLabel?.textColor
UIView.animateWithDuration(0.3, animations: {
self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
self.transform = CGAffineTransformMakeScale(15, 1.1)
self.transform = CGAffineTransformMakeScale(1.05, 1.1)
self.setTitleColor(UIColor.whiteColor(), forState: .Normal)
})
}
......
......@@ -19,6 +19,11 @@
import UIKit
public class RaisedButton : MaterialButton {
/**
:name: textColor
*/
public var textColor: UIColor?
//
// :name: prepareButton
//
......@@ -45,17 +50,16 @@ public class RaisedButton : MaterialButton {
let touchLocation = touch.locationInView(self)
pulseView = UIView()
pulseView!.frame = CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)
pulseView!.layer.cornerRadius = bounds.height / 2
pulseView!.layer.cornerRadius = bounds.height / 2.0
pulseView!.center = touchLocation
pulseView!.backgroundColor = pulseColor!.colorWithAlphaComponent(0.5)
backgroundColorView.addSubview(pulseView!)
UIView.animateWithDuration(0.3,
animations: {
textColor = self.titleLabel?.textColor
UIView.animateWithDuration(0.3, animations: {
self.pulseView!.transform = CGAffineTransformMakeScale(10, 10)
self.transform = CGAffineTransformMakeScale(15, 1.1)
},
completion: nil
)
self.transform = CGAffineTransformMakeScale(1.05, 1.1)
self.setTitleColor(UIColor.whiteColor(), forState: .Normal)
})
}
}
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