Commit e4c4ea9a by Daniel Dahan

updating spacing for Cards and Navbar

parent 0daf8760
...@@ -331,7 +331,7 @@ public class BasicCardView : MaterialPulseView { ...@@ -331,7 +331,7 @@ public class BasicCardView : MaterialPulseView {
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d)) addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : contentInsetsRef!.left + leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d))
} }
} }
...@@ -340,7 +340,7 @@ public class BasicCardView : MaterialPulseView { ...@@ -340,7 +340,7 @@ public class BasicCardView : MaterialPulseView {
if 0 < v.count { if 0 < v.count {
var h: String = "H:" var h: String = "H:"
var d: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>() var d: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
var i: Int = 0 var i: Int = v.count - 1
for b in v { for b in v {
let k: String = "b\(i)" let k: String = "b\(i)"
...@@ -349,17 +349,17 @@ public class BasicCardView : MaterialPulseView { ...@@ -349,17 +349,17 @@ public class BasicCardView : MaterialPulseView {
h += "[\(k)]" h += "[\(k)]"
if 0 == i++ { if 0 == i-- {
h += "-(right_left)-"
} else {
h += "-(right)-" h += "-(right)-"
} else {
h += "-(right_left)-"
} }
addSubview(b) addSubview(b)
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d)) addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : contentInsetsRef!.right + rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d))
} }
} }
......
...@@ -423,7 +423,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -423,7 +423,7 @@ public class ImageCardView : MaterialPulseView {
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d)) addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : contentInsetsRef!.left + leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d))
} }
} }
...@@ -432,7 +432,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -432,7 +432,7 @@ public class ImageCardView : MaterialPulseView {
if 0 < v.count { if 0 < v.count {
var h: String = "H:" var h: String = "H:"
var d: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>() var d: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
var i: Int = 0 var i: Int = v.count - 1
for b in v { for b in v {
let k: String = "b\(i)" let k: String = "b\(i)"
...@@ -441,17 +441,17 @@ public class ImageCardView : MaterialPulseView { ...@@ -441,17 +441,17 @@ public class ImageCardView : MaterialPulseView {
h += "[\(k)]" h += "[\(k)]"
if 0 == i++ { if 0 == i-- {
h += "-(right_left)-"
} else {
h += "-(right)-" h += "-(right)-"
} else {
h += "-(right_left)-"
} }
addSubview(b) addSubview(b)
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d)) addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : contentInsetsRef!.right + rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d))
} }
} }
......
...@@ -106,22 +106,16 @@ public class MaterialTextLayer : CATextLayer { ...@@ -106,22 +106,16 @@ public class MaterialTextLayer : CATextLayer {
didSet { didSet {
switch lineBreakMode { switch lineBreakMode {
case .ByWordWrapping: // Wrap at word boundaries, default case .ByWordWrapping: // Wrap at word boundaries, default
wrapped = true
truncationMode = kCATruncationNone truncationMode = kCATruncationNone
case .ByCharWrapping: // Wrap at character boundaries case .ByCharWrapping: // Wrap at character boundaries
wrapped = true
truncationMode = kCATruncationNone truncationMode = kCATruncationNone
case .ByClipping: // Simply clip case .ByClipping: // Simply clip
wrapped = false
truncationMode = kCATruncationNone truncationMode = kCATruncationNone
case .ByTruncatingHead: // Truncate at head of line: "...wxyz" case .ByTruncatingHead: // Truncate at head of line: "...wxyz"
wrapped = false
truncationMode = kCATruncationStart truncationMode = kCATruncationStart
case .ByTruncatingTail: // Truncate at tail of line: "abcd..." case .ByTruncatingTail: // Truncate at tail of line: "abcd..."
wrapped = false
truncationMode = kCATruncationEnd truncationMode = kCATruncationEnd
case .ByTruncatingMiddle: // Truncate middle of line: "ab...yz" case .ByTruncatingMiddle: // Truncate middle of line: "ab...yz"
wrapped = false
truncationMode = kCATruncationMiddle truncationMode = kCATruncationMiddle
} }
} }
......
...@@ -193,8 +193,8 @@ public extension MaterialTheme.navigationBarView { ...@@ -193,8 +193,8 @@ public extension MaterialTheme.navigationBarView {
public static var contentInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.Square2) public static var contentInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.Square2)
public static var titleLabelInsetsRef: MaterialInsetsType = (top: 20, left: 0, bottom: 0, right: 0) public static var titleLabelInsetsRef: MaterialInsetsType = (top: 20, left: 0, bottom: 0, right: 0)
public static var detailLabelInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.None) public static var detailLabelInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.None)
public static var leftButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 8, bottom: 0, right: -8) public static var leftButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 0, bottom: 0, right: 0)
public static var rightButtonsInsetsRef: MaterialInsetsType = (top: 8, left: -8, bottom: 0, right: 8) public static var rightButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 0, bottom: 0, right: 0)
// border // border
public static var borderWidth: MaterialBorder = .None public static var borderWidth: MaterialBorder = .None
......
...@@ -294,7 +294,7 @@ public class NavigationBarView : MaterialView { ...@@ -294,7 +294,7 @@ public class NavigationBarView : MaterialView {
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + leftButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d)) addConstraints(MaterialLayout.constraint(h, options: [], metrics: ["left" : contentInsetsRef!.left + leftButtonsInsetsRef!.left, "left_right" : leftButtonsInsetsRef!.left + leftButtonsInsetsRef!.right], views: d))
} }
} }
...@@ -322,7 +322,7 @@ public class NavigationBarView : MaterialView { ...@@ -322,7 +322,7 @@ public class NavigationBarView : MaterialView {
MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom) MaterialLayout.alignFromBottom(self, child: b, bottom: contentInsetsRef!.bottom + rightButtonsInsetsRef!.bottom)
} }
addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d)) addConstraints(MaterialLayout.constraint(h + "|", options: [], metrics: ["right" : contentInsetsRef!.right + rightButtonsInsetsRef!.right, "right_left" : rightButtonsInsetsRef!.right + rightButtonsInsetsRef!.left], views: d))
} }
} }
......
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