Commit 7e5548ed by Daniel Dahan

issue-7: BasicCard working with configuration through logical process

parent b32fe056
......@@ -36,7 +36,7 @@ public class BasicCard : MaterialCard {
public var divider: UIView? {
didSet {
divider!.setTranslatesAutoresizingMaskIntoConstraints(false)
divider!.backgroundColor = MaterialTheme.indigo.lighten1
divider!.backgroundColor = MaterialTheme.blueGrey.color
addSubview(divider!)
prepareCard()
}
......@@ -118,9 +118,9 @@ public class BasicCard : MaterialCard {
if nil != buttons {
// divider
if nil != divider {
// layoutConstraints += Layout.constraint("H:|-(0)-[divider(2)]-(0)-|", options: nil, metrics: nil, views: ["divider": divider!])
// views["divider"] = divider!
// verticalFormat += "-(10)-[divider]"
layoutConstraints += Layout.constraint("H:|[divider]|", options: nil, metrics: nil, views: ["divider": divider!])
views["divider"] = divider!
verticalFormat += "-(20)-[divider(1)]"
}
// buttons
var horizontalFormat: String = "H:|"
......@@ -131,11 +131,11 @@ public class BasicCard : MaterialCard {
buttonViews["button\(i)"] = button
views["button\(i)"] = button as AnyObject
horizontalFormat += "-(10)-[button\(i)]"
layoutConstraints += Layout.constraint(verticalFormat + "-(5)-[button\(i)]-(10)-|", options: nil, metrics: nil, views: views)
layoutConstraints += Layout.constraint(verticalFormat + "-(10)-[button\(i)]-(10)-|", options: nil, metrics: nil, views: views)
}
layoutConstraints += Layout.constraint(horizontalFormat, options: nil, metrics: nil, views: buttonViews)
} else {
verticalFormat += "-(10)-|"
verticalFormat += "-(20)-|"
}
if 0 < layoutConstraints.count {
......
......@@ -367,7 +367,7 @@ public struct MaterialTheme {
public static let lighten3: UIColor = UIColor(red: 159/255, green: 168/255, blue: 218/255, alpha: 1)
public static let lighten2: UIColor = UIColor(red: 121/255, green: 134/255, blue: 203/255, alpha: 1)
public static let lighten1: UIColor = UIColor(red: 92/255, green: 107/255, blue: 192/255, alpha: 1)
public static let color: UIColor = UIColor(red: 63/255, green: 81/255, blue: 181/255, alpha: 1)
public static let color: UIColor = UIColor(red: 96/255, green: 125/255, blue: 139/255, alpha: 1)
public static let darken1: UIColor = UIColor(red: 84/255, green: 110/255, blue: 122/255, alpha: 1)
public static let darken2: UIColor = UIColor(red: 48/255, green: 63/255, blue: 159/255, alpha: 1)
public static let darken3: UIColor = UIColor(red: 55/255, green: 71/255, blue: 79/255, alpha: 1)
......
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