Commit 58f7f5d2 by Daniel Dahan

added thin and bold fonts with updated interface

parent 144898ad
......@@ -13,6 +13,8 @@
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 */; };
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 */; };
9638325A1B88E31A0015F710 /* MaterialKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963832581B88E31A0015F710 /* MaterialKitTests.swift */; };
963832691B88E5BF0015F710 /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9638325E1B88E5BF0015F710 /* Capture.swift */; };
......@@ -60,6 +62,8 @@
/* Begin PBXFileReference section */
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>"; };
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; };
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>"; };
......@@ -239,6 +243,8 @@
9AAC38521B89553800FE6B2D /* Font */ = {
isa = PBXGroup;
children = (
65DBE41E1B9A9244000C804F /* Roboto-Bold.ttf */,
65DBE41F1B9A9244000C804F /* Roboto-Thin.ttf */,
9AAC38591B8956E300FE6B2D /* Roboto-Regular.ttf */,
9AAC38571B8956CF00FE6B2D /* Roboto-Medium.ttf */,
9AAC38551B8956C500FE6B2D /* Roboto-Light.ttf */,
......@@ -354,6 +360,8 @@
files = (
9A94D0FA1B895EA500F586A5 /* LICENSE 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 */,
9A94D0FD1B895EA500F586A5 /* Roboto-Light.ttf in Resources */,
);
......
......@@ -32,12 +32,12 @@ public class BasicCardView : MaterialCardView, Comparable, Equatable {
/**
:name: verticalSpace
*/
public var verticalSpace: CGFloat = 8
public var verticalSpace: CGFloat = MaterialTheme.verticalSpace
/**
:name: horizontalSpace
*/
public var horizontalSpace: CGFloat = 8
public var horizontalSpace: CGFloat = MaterialTheme.horizontalSpace
/**
:name: titleLabelContainer
......
......@@ -32,12 +32,12 @@ public class ImageCardView : MaterialCardView, Comparable, Equatable {
/**
:name: verticalSpace
*/
public var verticalSpace: CGFloat = 8
public var verticalSpace: CGFloat = MaterialTheme.verticalSpace
/**
:name: horizontalSpace
*/
public var horizontalSpace: CGFloat = 8
public var horizontalSpace: CGFloat = MaterialTheme.horizontalSpace
/**
:name: shadow
......
......@@ -24,9 +24,11 @@
<string></string>
<key>UIAppFonts</key>
<array>
<string>Roboto-Medium.ttf</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Thin</string>
<string>Roboto-Light.ttf</string>
<string>Roboto-Regular.ttf</string>
<string>Roboto-Medium.ttf</string>
<string>Roboto-Bold</string>
</array>
</dict>
</plist>
......@@ -18,7 +18,10 @@
import UIKit
public struct MaterialTheme {
public struct MaterialTheme {}
// colors
extension MaterialTheme {
// clear
public struct clear {
public static let color: UIColor = UIColor.clearColor()
......@@ -366,3 +369,14 @@ public struct MaterialTheme {
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 @@
import UIKit
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 {
if let f = UIFont(name: "Roboto-Light", size: size) {
return f
}
return UIFont.systemFontOfSize(size)
}
/**
:name: regular
*/
public static var regular: UIFont {
return regularWithSize(MaterialTheme.textFontSize)
}
/**
:name: mediumWithSize
*/
public static func mediumWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Medium", size: size) {
return f
}
return UIFont.systemFontOfSize(size)
}
/**
:name: medium
*/
public static var medium: UIFont {
return mediumWithSize(MaterialTheme.textFontSize)
}
/**
:name: regularWithSize
*/
public static func regularWithSize(size: CGFloat) -> UIFont {
if let f = UIFont(name: "Roboto-Regular", size: size) {
return f
}
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