Commit 58f7f5d2 by Daniel Dahan

added thin and bold fonts with updated interface

parent 144898ad
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
657CD02F1B8EE0D3008C0029 /* ImageCardView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9A94D10A1B8A485C00F586A5 /* ImageCardView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 657CD02F1B8EE0D3008C0029 /* ImageCardView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9A94D10A1B8A485C00F586A5 /* ImageCardView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
65B9657E1B8A7C330055B139 /* MaterialButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B9657D1B8A7C330055B139 /* MaterialButton.swift */; }; 65B9657E1B8A7C330055B139 /* MaterialButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B9657D1B8A7C330055B139 /* MaterialButton.swift */; };
65B965871B8BEEC60055B139 /* SideNavController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B965861B8BEEC60055B139 /* SideNavController.swift */; }; 65B965871B8BEEC60055B139 /* SideNavController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B965861B8BEEC60055B139 /* SideNavController.swift */; };
65DBE4201B9A9244000C804F /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65DBE41E1B9A9244000C804F /* Roboto-Bold.ttf */; };
65DBE4211B9A9244000C804F /* Roboto-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65DBE41F1B9A9244000C804F /* Roboto-Thin.ttf */; };
963832421B88DFD80015F710 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* MaterialKit.framework */; }; 963832421B88DFD80015F710 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* MaterialKit.framework */; };
9638325A1B88E31A0015F710 /* MaterialKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963832581B88E31A0015F710 /* MaterialKitTests.swift */; }; 9638325A1B88E31A0015F710 /* MaterialKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963832581B88E31A0015F710 /* MaterialKitTests.swift */; };
963832691B88E5BF0015F710 /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9638325E1B88E5BF0015F710 /* Capture.swift */; }; 963832691B88E5BF0015F710 /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9638325E1B88E5BF0015F710 /* Capture.swift */; };
...@@ -60,6 +62,8 @@ ...@@ -60,6 +62,8 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
65B9657D1B8A7C330055B139 /* MaterialButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialButton.swift; sourceTree = "<group>"; }; 65B9657D1B8A7C330055B139 /* MaterialButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialButton.swift; sourceTree = "<group>"; };
65B965861B8BEEC60055B139 /* SideNavController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideNavController.swift; sourceTree = "<group>"; }; 65B965861B8BEEC60055B139 /* SideNavController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideNavController.swift; sourceTree = "<group>"; };
65DBE41E1B9A9244000C804F /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Bold.ttf"; sourceTree = "<group>"; };
65DBE41F1B9A9244000C804F /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = "<group>"; };
963832361B88DFD80015F710 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MaterialKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 963832361B88DFD80015F710 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MaterialKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
963832411B88DFD80015F710 /* MaterialKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MaterialKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 963832411B88DFD80015F710 /* MaterialKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MaterialKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
963832541B88E30F0015F710 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 963832541B88E30F0015F710 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
...@@ -239,6 +243,8 @@ ...@@ -239,6 +243,8 @@
9AAC38521B89553800FE6B2D /* Font */ = { 9AAC38521B89553800FE6B2D /* Font */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
65DBE41E1B9A9244000C804F /* Roboto-Bold.ttf */,
65DBE41F1B9A9244000C804F /* Roboto-Thin.ttf */,
9AAC38591B8956E300FE6B2D /* Roboto-Regular.ttf */, 9AAC38591B8956E300FE6B2D /* Roboto-Regular.ttf */,
9AAC38571B8956CF00FE6B2D /* Roboto-Medium.ttf */, 9AAC38571B8956CF00FE6B2D /* Roboto-Medium.ttf */,
9AAC38551B8956C500FE6B2D /* Roboto-Light.ttf */, 9AAC38551B8956C500FE6B2D /* Roboto-Light.ttf */,
...@@ -354,6 +360,8 @@ ...@@ -354,6 +360,8 @@
files = ( files = (
9A94D0FA1B895EA500F586A5 /* LICENSE in Resources */, 9A94D0FA1B895EA500F586A5 /* LICENSE in Resources */,
9A94D0FB1B895EA500F586A5 /* Roboto-Regular.ttf in Resources */, 9A94D0FB1B895EA500F586A5 /* Roboto-Regular.ttf in Resources */,
65DBE4211B9A9244000C804F /* Roboto-Thin.ttf in Resources */,
65DBE4201B9A9244000C804F /* Roboto-Bold.ttf in Resources */,
9A94D0FC1B895EA500F586A5 /* Roboto-Medium.ttf in Resources */, 9A94D0FC1B895EA500F586A5 /* Roboto-Medium.ttf in Resources */,
9A94D0FD1B895EA500F586A5 /* Roboto-Light.ttf in Resources */, 9A94D0FD1B895EA500F586A5 /* Roboto-Light.ttf in Resources */,
); );
......
...@@ -32,12 +32,12 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable { ...@@ -32,12 +32,12 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
/** /**
:name: verticalSpace :name: verticalSpace
*/ */
public var verticalSpace: CGFloat = 8 public var verticalSpace: CGFloat = MaterialTheme.verticalSpace
/** /**
:name: horizontalSpace :name: horizontalSpace
*/ */
public var horizontalSpace: CGFloat = 8 public var horizontalSpace: CGFloat = MaterialTheme.horizontalSpace
/** /**
:name: titleLabelContainer :name: titleLabelContainer
......
...@@ -32,12 +32,12 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable { ...@@ -32,12 +32,12 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
/** /**
:name: verticalSpace :name: verticalSpace
*/ */
public var verticalSpace: CGFloat = 8 public var verticalSpace: CGFloat = MaterialTheme.verticalSpace
/** /**
:name: horizontalSpace :name: horizontalSpace
*/ */
public var horizontalSpace: CGFloat = 8 public var horizontalSpace: CGFloat = MaterialTheme.horizontalSpace
/** /**
:name: shadow :name: shadow
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
<string></string> <string></string>
<key>UIAppFonts</key> <key>UIAppFonts</key>
<array> <array>
<string>Roboto-Medium.ttf</string> <string>Roboto-Thin</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Light.ttf</string> <string>Roboto-Light.ttf</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Medium.ttf</string>
<string>Roboto-Bold</string>
</array> </array>
</dict> </dict>
</plist> </plist>
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
import UIKit import UIKit
public struct MaterialTheme { public struct MaterialTheme {}
// colors
extension MaterialTheme {
// clear // clear
public struct clear { public struct clear {
public static let color: UIColor = UIColor.clearColor() public static let color: UIColor = UIColor.clearColor()
...@@ -366,3 +369,14 @@ public struct MaterialTheme { ...@@ -366,3 +369,14 @@ public struct MaterialTheme {
public static let darken4: UIColor = UIColor(red: 38/255, green: 50/255, blue: 56/255, alpha: 1) public static let darken4: UIColor = UIColor(red: 38/255, green: 50/255, blue: 56/255, alpha: 1)
} }
} }
// spacing
extension MaterialTheme {
public static var verticalSpace: CGFloat = 16
public static var horizontalSpace: CGFloat = 16
}
// fonts
extension MaterialTheme {
public static var textFontSize: CGFloat = 16
}
\ No newline at end of file
...@@ -19,24 +19,88 @@ ...@@ -19,24 +19,88 @@
import UIKit import UIKit
public struct Roboto { public struct Roboto {
/**
:name: thin
*/
public static var thin: UIFont {
return thinWithSize(MaterialTheme.textFontSize)
}
/**
:name: thinWithSize
*/
public static func thinWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Thin", size: size) {
return f
}
return UIFont.systemFontOfSize(size)
}
/**
:name: light
*/
public static var light: UIFont {
return lightWithSize(MaterialTheme.textFontSize)
}
/**
:name: lightWithSize
*/
public static func lightWithSize(size: CGFloat) -> UIFont { public static func lightWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Light", size: size) { if let f = UIFont(name: "Roboto-Light", size: size) {
return f return f
} }
return UIFont.systemFontOfSize(size) return UIFont.systemFontOfSize(size)
} }
/**
:name: regular
*/
public static var regular: UIFont {
return regularWithSize(MaterialTheme.textFontSize)
}
/**
:name: mediumWithSize
*/
public static func mediumWithSize(size: CGFloat) -> UIFont { public static func mediumWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Medium", size: size) { if let f = UIFont(name: "Roboto-Medium", size: size) {
return f return f
} }
return UIFont.systemFontOfSize(size) return UIFont.systemFontOfSize(size)
} }
/**
:name: medium
*/
public static var medium: UIFont {
return mediumWithSize(MaterialTheme.textFontSize)
}
/**
:name: regularWithSize
*/
public static func regularWithSize(size: CGFloat) -> UIFont { public static func regularWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Regular", size: size) { if let f = UIFont(name: "Roboto-Regular", size: size) {
return f return f
} }
return UIFont.systemFontOfSize(size) return UIFont.systemFontOfSize(size)
} }
/**
:name: bold
*/
public static var bold: UIFont {
return boldWithSize(MaterialTheme.textFontSize)
}
/**
:name: boldWithSize
*/
public static func boldWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Regular", size: size) {
return f
}
return UIFont.systemFontOfSize(size)
}
} }
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