Commit 5fdb65df by Daniel Dahan

development: updated ImageCard and added defaults

parent 448b0318
......@@ -35,8 +35,6 @@
963832891B89097D0015F710 /* Layout.swift in Headers */ = {isa = PBXBuildFile; fileRef = 963832871B8908180015F710 /* Layout.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96B57D4E1B90AF7D00DE7BBB /* MaterialTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B57D4D1B90AF7D00DE7BBB /* MaterialTheme.swift */; };
96C910ED1B95804B00E7CE5C /* MaterialTheme.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96B57D4D1B90AF7D00DE7BBB /* MaterialTheme.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96C910EE1B95804B00E7CE5C /* ImageRevealCard.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9A3A3B701B8EB582005F16BC /* ImageRevealCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */; };
9A94D0F91B895C8C00F586A5 /* Roboto.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9AAC38531B89559900FE6B2D /* Roboto.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9A94D0FA1B895EA500F586A5 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 963832631B88E5BF0015F710 /* LICENSE */; };
9A94D0FB1B895EA500F586A5 /* Roboto-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9AAC38591B8956E300FE6B2D /* Roboto-Regular.ttf */; };
......@@ -78,7 +76,6 @@
963832681B88E5BF0015F710 /* TextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = "<group>"; };
963832871B8908180015F710 /* Layout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Layout.swift; sourceTree = "<group>"; };
96B57D4D1B90AF7D00DE7BBB /* MaterialTheme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTheme.swift; sourceTree = "<group>"; };
9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageRevealCard.swift; sourceTree = "<group>"; };
9A94D1081B8A3F5100F586A5 /* MaterialCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialCard.swift; sourceTree = "<group>"; };
9A94D10A1B8A485C00F586A5 /* ImageCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCard.swift; sourceTree = "<group>"; };
9AAC384C1B89528900FE6B2D /* BasicCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicCard.swift; sourceTree = "<group>"; };
......@@ -235,7 +232,6 @@
9A94D1081B8A3F5100F586A5 /* MaterialCard.swift */,
9AAC384C1B89528900FE6B2D /* BasicCard.swift */,
9A94D10A1B8A485C00F586A5 /* ImageCard.swift */,
9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */,
);
name = Card;
sourceTree = "<group>";
......@@ -273,7 +269,6 @@
657CD02C1B8EE0D3008C0029 /* SideNavController.swift in Headers */,
657CD02D1B8EE0D3008C0029 /* MaterialButton.swift in Headers */,
96C910ED1B95804B00E7CE5C /* MaterialTheme.swift in Headers */,
96C910EE1B95804B00E7CE5C /* ImageRevealCard.swift in Headers */,
657CD02F1B8EE0D3008C0029 /* ImageCard.swift in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -383,7 +378,6 @@
96B57D4E1B90AF7D00DE7BBB /* MaterialTheme.swift in Sources */,
9638326B1B88E5BF0015F710 /* FabButton.swift in Sources */,
9A94D1091B8A3F5100F586A5 /* MaterialCard.swift in Sources */,
9A3A3B701B8EB582005F16BC /* ImageRevealCard.swift in Sources */,
65B965871B8BEEC60055B139 /* SideNavController.swift in Sources */,
9638326C1B88E5BF0015F710 /* FlatButton.swift in Sources */,
963832711B88E5BF0015F710 /* Text.swift in Sources */,
......
......@@ -35,9 +35,9 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
public var verticalSpace: CGFloat = 8
/**
:name: maximumDetailHeight
:name: horizontalSpace
*/
public var maximumDetailHeight: CGFloat = 144
public var horizontalSpace: CGFloat = 8
/**
:name: titleLabelContainer
......@@ -74,6 +74,7 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
t.backgroundColor = MaterialTheme.clear.color
t.font = Roboto.mediumWithSize(18)
t.numberOfLines = 1
prepareCard()
} else {
titleLabelContainer?.removeFromSuperview()
}
......@@ -81,6 +82,11 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
}
/**
:name: maximumDetailLabelHeight
*/
public var maximumDetailLabelHeight: CGFloat = 144
/**
:name: detailLabelContainer
*/
public private(set) var detailLabelContainer: UIView?
......@@ -203,7 +209,7 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
views["titleLabelContainer"] = titleLabelContainer!
// text
titleLabelContainer!.addConstraints(Layout.constraint("H:|-(verticalSpace)-[titleLabel]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace], views: ["titleLabel": titleLabel!]))
titleLabelContainer!.addConstraints(Layout.constraint("H:|-(horizontalSpace)-[titleLabel]-(horizontalSpace)-|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: ["titleLabel": titleLabel!]))
titleLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[titleLabel(height)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "height": titleLabel!.font.pointSize + verticalSpace], views: ["titleLabel": titleLabel!]))
}
......@@ -215,8 +221,8 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
views["detailLabelContainer"] = detailLabelContainer!
// text
detailLabelContainer!.addConstraints(Layout.constraint("H:|-(verticalSpace)-[detailLabel]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[detailLabel(<=maximumDetailHeight)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "maximumDetailHeight": maximumDetailHeight], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("H:|-(horizontalSpace)-[detailLabel]-(horizontalSpace)-|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "maximumDetailLabelHeight": maximumDetailLabelHeight], views: ["detailLabel": detailLabel!]))
}
if nil != buttonsContainer && (nil != leftButtons || nil != rightButtons) {
......@@ -240,10 +246,10 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
let button: MaterialButton = leftButtons![i]
buttonsContainer!.addSubview(button)
buttonViews["button\(i)"] = button
horizontalFormat += "-(verticalSpace)-[button\(i)]"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: verticalSpace, bottom: verticalSpace)
horizontalFormat += "-(horizontalSpace)-[button\(i)]"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: horizontalSpace, bottom: verticalSpace)
}
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat, options: nil, metrics: ["verticalSpace": verticalSpace], views: buttonViews))
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat, options: nil, metrics: ["horizontalSpace": horizontalSpace], views: buttonViews))
}
// rightButtons
......@@ -254,10 +260,10 @@ public class BasicCard : MaterialCard, Comparable, Equatable {
let button: MaterialButton = rightButtons![i]
buttonsContainer!.addSubview(button)
buttonViews["button\(i)"] = button
horizontalFormat += "[button\(i)]-(verticalSpace)-"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: verticalSpace, bottom: verticalSpace)
horizontalFormat += "[button\(i)]-(horizontalSpace)-"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: horizontalSpace, bottom: verticalSpace)
}
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat + "|", options: nil, metrics: ["verticalSpace": verticalSpace], views: buttonViews))
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat + "|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: buttonViews))
}
}
......
......@@ -27,7 +27,7 @@ public class FlatButton : MaterialButton {
setTitleColor(MaterialTheme.indigo.darken1, forState: .Normal)
pulseColor = MaterialTheme.indigo.darken1
backgroundColor = MaterialTheme.clear.color
contentEdgeInsets = UIEdgeInsetsMake(4, 4, 4, 4)
contentEdgeInsets = UIEdgeInsetsMake(4, 16, 4, 16)
}
//
......
......@@ -30,31 +30,72 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
internal lazy var views: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
/**
:name: verticalSpace
:name: verticalSpace
*/
public var verticalSpace: CGFloat = 8
/**
:name: maximumDetailHeight
:name: horizontalSpace
*/
public var maximumDetailHeight: CGFloat = 144
public var horizontalSpace: CGFloat = 8
/**
:name: titleLabelContainer
:name: shadow
*/
public private(set) var titleLabelContainer: UIView?
public var shadow: Bool = true {
didSet {
false == shadow ? removeShadow() : prepareShadow()
}
}
/**
:name: shadow
:name: maximumImageViewHeight
*/
public var shadow: Bool = true {
public var maximumImageViewHeight: CGFloat = 200
/**
:name: imageViewContainer
*/
public private(set) var imageViewContainer: UIView?
/**
:name: imageView
*/
public var imageView: UIImageView? {
didSet {
false == shadow ? removeShadow() : prepareShadow()
if let t = imageView {
// container
if nil == imageViewContainer {
imageViewContainer = UIView()
imageViewContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
imageViewContainer!.backgroundColor = MaterialTheme.clear.color
insertSubview(imageViewContainer!, belowSubview: backgroundColorView)
}
// text
imageViewContainer!.addSubview(t)
t.setTranslatesAutoresizingMaskIntoConstraints(false)
t.contentMode = .ScaleAspectFill
t.userInteractionEnabled = false
t.clipsToBounds = true
if nil != titleLabel {
titleLabelContainer!.removeFromSuperview()
imageViewContainer!.addSubview(titleLabelContainer!)
}
prepareCard()
} else {
imageViewContainer?.removeFromSuperview()
}
}
}
/**
:name: titleLabel
:name: titleLabelContainer
*/
public private(set) var titleLabelContainer: UIView?
/**
:name: titleLabel
*/
public var titleLabel: UILabel? {
didSet {
......@@ -74,6 +115,13 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
t.backgroundColor = MaterialTheme.clear.color
t.font = Roboto.mediumWithSize(18)
t.numberOfLines = 1
if nil == imageView {
titleLabelContainer!.addSubview(t)
} else {
titleLabelContainer!.removeFromSuperview()
imageViewContainer!.addSubview(titleLabelContainer!)
}
prepareCard()
} else {
titleLabelContainer?.removeFromSuperview()
}
......@@ -81,12 +129,17 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
}
/**
:name: detailLabelContainer
:name: maximumDetailLabelHeight
*/
public var maximumDetailLabelHeight: CGFloat = 144
/**
:name: detailLabelContainer
*/
public private(set) var detailLabelContainer: UIView?
/**
:name: detailLabel
:name: detailLabel
*/
public var detailLabel: UILabel? {
didSet {
......@@ -95,16 +148,16 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
if nil == detailLabelContainer {
detailLabelContainer = UIView()
detailLabelContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
detailLabelContainer!.backgroundColor = MaterialTheme.clear.color
detailLabelContainer!.backgroundColor = MaterialTheme.white.color
addSubview(detailLabelContainer!)
}
// text
detailLabelContainer!.addSubview(l)
l.setTranslatesAutoresizingMaskIntoConstraints(false)
l.textColor = MaterialTheme.white.color
l.textColor = MaterialTheme.black.color
l.backgroundColor = MaterialTheme.clear.color
l.font = Roboto.lightWithSize(12)
l.font = Roboto.lightWithSize(16)
l.numberOfLines = 0
l.lineBreakMode = .ByWordWrapping
prepareCard()
......@@ -115,13 +168,13 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
}
/**
:name: divider
:name: divider
*/
public var divider: UIView? {
didSet {
if let d = divider {
d.setTranslatesAutoresizingMaskIntoConstraints(false)
d.backgroundColor = MaterialTheme.blueGrey.color
d.backgroundColor = MaterialTheme.blueGrey.lighten5
addSubview(d)
prepareCard()
} else {
......@@ -131,7 +184,7 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
}
/**
:name: buttonsContainer
:name: buttonsContainer
*/
public private(set) var buttonsContainer: UIView?
......@@ -144,7 +197,7 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
buttonsContainer!.backgroundColor = MaterialTheme.clear.color
buttonsContainer!.backgroundColor = MaterialTheme.white.color
addSubview(buttonsContainer!)
}
prepareCard()
......@@ -155,7 +208,7 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
}
/**
:name: rightButtons
:name: rightButtons
*/
public var rightButtons: Array<MaterialButton>? {
didSet {
......@@ -163,7 +216,7 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
buttonsContainer!.backgroundColor = MaterialTheme.clear.color
buttonsContainer!.backgroundColor = MaterialTheme.white.color
addSubview(buttonsContainer!)
}
prepareCard()
......@@ -179,7 +232,7 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
internal override func prepareView() {
super.prepareView()
prepareShadow()
backgroundColor = MaterialTheme.blueGrey.darken1
backgroundColor = MaterialTheme.clear.color
}
//
......@@ -195,16 +248,37 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
// detect all components and create constraints
var verticalFormat: String = "V:|"
// title
if nil != titleLabelContainer && nil != titleLabel {
// image
if nil != imageViewContainer && nil != imageView {
// container
layoutConstraints += Layout.constraint("H:|[titleLabelContainer]|", options: nil, metrics: nil, views: ["titleLabelContainer": titleLabelContainer!])
verticalFormat += "[titleLabelContainer]"
views["titleLabelContainer"] = titleLabelContainer!
layoutConstraints += Layout.constraint("H:|[imageViewContainer]|", options: nil, metrics: nil, views: ["imageViewContainer": imageViewContainer!])
verticalFormat += "[imageViewContainer]"
views["imageViewContainer"] = imageViewContainer!
// text
titleLabelContainer!.addConstraints(Layout.constraint("H:|-(verticalSpace)-[titleLabel]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace], views: ["titleLabel": titleLabel!]))
titleLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[titleLabel(height)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "height": titleLabel!.font.pointSize], views: ["titleLabel": titleLabel!]))
imageViewContainer!.addConstraints(Layout.constraint("H:|[imageView]|", options: nil, metrics: nil, views: ["imageView": imageView!]))
imageViewContainer!.addConstraints(Layout.constraint("V:|[imageView(maximumImageViewHeight)]|", options: nil, metrics: ["maximumImageViewHeight": maximumImageViewHeight], views: ["imageView": imageView!]))
}
// title
if nil != titleLabelContainer && nil != titleLabel {
if nil == imageView {
// container
layoutConstraints += Layout.constraint("H:|[titleLabelContainer]|", options: nil, metrics: nil, views: ["titleLabelContainer": titleLabelContainer!])
verticalFormat += "[titleLabelContainer]"
views["titleLabelContainer"] = titleLabelContainer!
// text
titleLabelContainer!.addConstraints(Layout.constraint("H:|-(horizontalSpace)-[titleLabel]-(horizontalSpace)-|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: ["titleLabel": titleLabel!]))
titleLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[titleLabel(height)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "height": titleLabel!.font.pointSize + verticalSpace], views: ["titleLabel": titleLabel!]))
} else {
//container
Layout.expandToParent(imageViewContainer!, child: titleLabelContainer!)
// text
titleLabelContainer!.addConstraints(Layout.constraint("H:|-(horizontalSpace)-[titleLabel]-(horizontalSpace)-|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: ["titleLabel": titleLabel!]))
titleLabelContainer!.addConstraints(Layout.constraint("V:[titleLabel(height)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "height": titleLabel!.font.pointSize + verticalSpace], views: ["titleLabel": titleLabel!]))
}
}
// detail
......@@ -215,8 +289,8 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
views["detailLabelContainer"] = detailLabelContainer!
// text
detailLabelContainer!.addConstraints(Layout.constraint("H:|-(verticalSpace)-[detailLabel]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[detailLabel(<=maximumDetailHeight)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "maximumDetailHeight": maximumDetailHeight], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("H:|-(horizontalSpace)-[detailLabel]-(horizontalSpace)-|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: ["detailLabel": detailLabel!]))
detailLabelContainer!.addConstraints(Layout.constraint("V:|-(verticalSpace)-[detailLabel(<=maximumDetailLabelHeight)]-(verticalSpace)-|", options: nil, metrics: ["verticalSpace": verticalSpace, "maximumDetailLabelHeight": maximumDetailLabelHeight], views: ["detailLabel": detailLabel!]))
}
if nil != buttonsContainer && (nil != leftButtons || nil != rightButtons) {
......@@ -240,10 +314,10 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
let button: MaterialButton = leftButtons![i]
buttonsContainer!.addSubview(button)
buttonViews["button\(i)"] = button
horizontalFormat += "-(verticalSpace)-[button\(i)]"
horizontalFormat += "-(horizontalSpace)-[button\(i)]"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: verticalSpace, bottom: verticalSpace)
}
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat, options: nil, metrics: ["verticalSpace": verticalSpace], views: buttonViews))
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat, options: nil, metrics: ["horizontalSpace": horizontalSpace], views: buttonViews))
}
// rightButtons
......@@ -254,10 +328,10 @@ public class ImageCard : MaterialCard, Comparable, Equatable {
let button: MaterialButton = rightButtons![i]
buttonsContainer!.addSubview(button)
buttonViews["button\(i)"] = button
horizontalFormat += "[button\(i)]-(verticalSpace)-"
horizontalFormat += "[button\(i)]-(horizontalSpace)-"
Layout.expandToParentVerticallyWithPad(buttonsContainer!, child: button, top: verticalSpace, bottom: verticalSpace)
}
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat + "|", options: nil, metrics: ["verticalSpace": verticalSpace], views: buttonViews))
buttonsContainer!.addConstraints(Layout.constraint(horizontalFormat + "|", options: nil, metrics: ["horizontalSpace": horizontalSpace], views: buttonViews))
}
}
......
////
//// RevealCard.swift
//// MaterialKit
////
//// Created by Adam Dahan on 2015-08-26.
//// Copyright (c) 2015 GraphKit Inc. All rights reserved.
////
//
//import UIKit
//
//public class ImageRevealCard : ImageCard {
//
// private lazy var revealView: UIView = UIView()
// private lazy var tapGesture: UITapGestureRecognizer = UITapGestureRecognizer()
// private lazy var metrics: Dictionary <String, AnyObject> = Dictionary <String, AnyObject>()
// private var topLayoutConstraint: NSLayoutConstraint!
// private lazy var hideRevealViewButton: UIButton = UIButton()
//
// public required init(coder aDecoder: NSCoder) {
// super.init(coder: aDecoder)
// }
//
// public required init(frame: CGRect) {
// super.init(frame: frame)
// }
//
// internal override func initialize() {
// prepareTapGestures()
// prepareRevealView()
// prepareHideRevealViewButton()
// super.initialize()
// }
//
// public override func layoutSubviews() {
// super.layoutSubviews()
// revealView.frame = CGRectMake(0, 0, bounds.width, bounds.height)
// hideRevealViewButton.frame = CGRectMake(CGRectGetMaxX(revealView.frame) - 50, 10, 40, 40)
// }
//
// private func prepareTapGestures() {
// tapGesture.addTarget(self, action: "showRevealView")
// imageView.userInteractionEnabled = true
// addGestureRecognizer(tapGesture)
// }
//
// private func prepareRevealView() {
// revealView.backgroundColor = .whiteColor()
// revealView.hidden = true
// imageView.addSubview(revealView)
// }
//
// private func prepareHideRevealViewButton() {
// hideRevealViewButton.setImage(UIImage(named: "ic_clear"), forState: .Normal)
// hideRevealViewButton.tintColor = .whiteColor()
// hideRevealViewButton.addTarget(self, action: "hideRevealView", forControlEvents: UIControlEvents.TouchUpInside)
// revealView.addSubview(hideRevealViewButton)
// }
//
// internal func showRevealView() {
// removeTapGestures()
// revealView.hidden = false
// revealView.frame = CGRectMake(0, bounds.height, bounds.width, bounds.height)
// UIView.animateWithDuration(0.3, animations: { () -> Void in
// var frame = self.revealView.frame
// frame.origin.y -= self.bounds.height
// self.revealView.frame = frame
// })
// }
//
// internal func hideRevealView() {
// UIView.animateWithDuration(0.3, animations: { () -> Void in
// var frame = self.revealView.frame
// frame.origin.y = self.bounds.height
// self.revealView.frame = frame
// }) { (finished) -> Void in
// self.revealView.hidden = true
// self.prepareTapGestures()
// }
// }
//
// private func removeTapGestures() {
// removeGestureRecognizer(tapGesture)
// }
//}
//
//
//
......@@ -44,7 +44,7 @@ public class MaterialButton : UIButton {
/**
:name: pulseColor
*/
public var pulseColor: UIColor? = MaterialTheme.white.color
public var pulseColor: UIColor? = MaterialTheme.blueGrey.lighten3
/**
:name: init
......
......@@ -44,7 +44,7 @@ public class MaterialCard : UIView {
/**
:name: pulseColor
*/
public var pulseColor: UIColor = MaterialTheme.white.color
public var pulseColor: UIColor = MaterialTheme.blueGrey.lighten3
/**
:name: init
......
......@@ -26,7 +26,7 @@ public class RaisedButton : MaterialButton {
super.prepareView()
setTitleColor(MaterialTheme.white.color, forState: .Normal)
backgroundColor = MaterialTheme.indigo.darken1
contentEdgeInsets = UIEdgeInsetsMake(4, 4, 4, 4)
contentEdgeInsets = UIEdgeInsetsMake(4, 16, 4, 16)
}
//
......
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