Commit 63ce6b94 by Daniel Dahan

development: progression commit for HeightPreset and Bar height updates

parent 5c2d849d
...@@ -57,22 +57,25 @@ class ViewController: UIViewController { ...@@ -57,22 +57,25 @@ class ViewController: UIViewController {
private func prepareMenuButton() { private func prepareMenuButton() {
menuButton = IconButton(image: Icon.cm.menu, tintColor: .white) menuButton = IconButton(image: Icon.cm.menu, tintColor: .white)
menuButton.pulseColor = .white
} }
private func prepareFavoriteButton() { private func prepareFavoriteButton() {
favoriteButton = IconButton(image: Icon.favorite, tintColor: .white) favoriteButton = IconButton(image: Icon.favorite, tintColor: .white)
favoriteButton.pulseColor = .white
} }
private func prepareShareButton() { private func prepareShareButton() {
shareButton = IconButton(image: Icon.cm.share, tintColor: .white) shareButton = IconButton(image: Icon.cm.share, tintColor: .white)
shareButton.pulseColor = .white
} }
private func prepareBar() { private func prepareBar() {
bar = Bar(leftViews: [menuButton], rightViews: [favoriteButton, shareButton]) bar = Bar(leftViews: [menuButton], rightViews: [favoriteButton, shareButton])
bar.backgroundColor = .blue.base bar.backgroundColor = Color.blue.base
bar.contentView.cornerRadiusPreset = .cornerRadius1 bar.contentView.cornerRadiusPreset = .cornerRadius1
bar.contentView.backgroundColor = .blue.lighten3 bar.contentView.backgroundColor = Color.blue.lighten3
view.layout(bar).horizontally().center() view.layout(bar).horizontally().center()
} }
......
...@@ -39,6 +39,6 @@ class AppBottomNavigationController: BottomNavigationController { ...@@ -39,6 +39,6 @@ class AppBottomNavigationController: BottomNavigationController {
private func prepareTabBar() { private func prepareTabBar() {
tabBar.depthPreset = .none tabBar.depthPreset = .none
tabBar.dividerColor = .grey.lighten3 tabBar.dividerColor = Color.grey.lighten3
} }
} }
...@@ -39,12 +39,12 @@ class AudioViewController: UIViewController { ...@@ -39,12 +39,12 @@ class AudioViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.audioLibrary?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.audioLibrary?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.audioLibrary?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.audioLibrary?.tint(with: Color.blue.base)
} }
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .blue.base view.backgroundColor = Color.blue.base
} }
} }
...@@ -39,12 +39,12 @@ class PhotoViewController: UIViewController { ...@@ -39,12 +39,12 @@ class PhotoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.photoCamera?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.photoCamera?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.photoCamera?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.photoCamera?.tint(with: Color.blue.base)
} }
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .red.base view.backgroundColor = Color.red.base
} }
} }
...@@ -39,12 +39,12 @@ class RemindersViewController: UIViewController { ...@@ -39,12 +39,12 @@ class RemindersViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.bell?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.bell?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.bell?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.bell?.tint(with: Color.blue.base)
} }
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .yellow.base view.backgroundColor = Color.yellow.base
} }
} }
...@@ -39,12 +39,12 @@ class SearchViewController: UIViewController { ...@@ -39,12 +39,12 @@ class SearchViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.search?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.search?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.search?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.search?.tint(with: Color.blue.base)
} }
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = .blueGrey.base view.backgroundColor = Color.blueGrey.base
} }
} }
...@@ -39,12 +39,12 @@ class VideoViewController: UIViewController { ...@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.videocam?.tint(with: blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.videocam?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.videocam?.tint(with: blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.videocam?.tint(with: Color.blue.base)
} }
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = green.base view.backgroundColor = Color.green.base
} }
} }
...@@ -58,7 +58,7 @@ struct ButtonLayout { ...@@ -58,7 +58,7 @@ struct ButtonLayout {
class ViewController: UIViewController { class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareFlatButton() prepareFlatButton()
prepareRaisedButton() prepareRaisedButton()
...@@ -76,8 +76,9 @@ class ViewController: UIViewController { ...@@ -76,8 +76,9 @@ class ViewController: UIViewController {
} }
private func prepareRaisedButton() { private func prepareRaisedButton() {
let button = RaisedButton(title: "Raised Button", titleColor: white) let button = RaisedButton(title: "Raised Button", titleColor: .white)
button.backgroundColor = blue.base button.pulseColor = .white
button.backgroundColor = Color.blue.base
view.layout(button) view.layout(button)
.width(ButtonLayout.Raised.width) .width(ButtonLayout.Raised.width)
...@@ -86,7 +87,7 @@ class ViewController: UIViewController { ...@@ -86,7 +87,7 @@ class ViewController: UIViewController {
} }
private func prepareFabButton() { private func prepareFabButton() {
let button = FabButton(image: Icon.cm.add, tintColor: white) let button = FabButton(image: Icon.cm.add, tintColor: .white)
view.layout(button) view.layout(button)
.width(ButtonLayout.Fab.diameter) .width(ButtonLayout.Fab.diameter)
......
...@@ -42,7 +42,7 @@ class AppCaptureController: CaptureController { ...@@ -42,7 +42,7 @@ class AppCaptureController: CaptureController {
private func prepareToolbar() { private func prepareToolbar() {
toolbar.titleLabel.isHidden = true toolbar.titleLabel.isHidden = true
toolbar.titleLabel.textColor = white toolbar.titleLabel.textColor = .white
toolbar.detailLabel.isHidden = true toolbar.detailLabel.isHidden = true
toolbar.detail = "Recording" toolbar.detail = "Recording"
...@@ -56,7 +56,7 @@ class AppCaptureController: CaptureController { ...@@ -56,7 +56,7 @@ class AppCaptureController: CaptureController {
captureButton.width = 72 captureButton.width = 72
captureButton.height = 72 captureButton.height = 72
captureButton.backgroundColor = red.darken1.withAlphaComponent(0.3) captureButton.backgroundColor = red.darken1.withAlphaComponent(0.3)
captureButton.borderColor = white captureButton.borderColor = .white
captureButton.borderWidthPreset = .border3 captureButton.borderWidthPreset = .border3
captureButton.depthPreset = .none captureButton.depthPreset = .none
} }
......
...@@ -136,7 +136,7 @@ extension ViewController: CaptureDelegate { ...@@ -136,7 +136,7 @@ extension ViewController: CaptureDelegate {
} }
public func captureDidPressCameraButton(capture: Capture, button: UIButton) { public func captureDidPressCameraButton(capture: Capture, button: UIButton) {
// captureButton.backgroundColor = blue.darken1.withAlphaComponent(0.3) // captureButton.backgroundColor = Color.blue.darken1.withAlphaComponent(0.3)
} }
public func captureDidPressVideoButton(capture: Capture, button: UIButton) { public func captureDidPressVideoButton(capture: Capture, button: UIButton) {
......
...@@ -50,7 +50,7 @@ class ViewController: UIViewController { ...@@ -50,7 +50,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareDateFormatter() prepareDateFormatter()
prepareDateLabel() prepareDateLabel()
...@@ -71,16 +71,16 @@ class ViewController: UIViewController { ...@@ -71,16 +71,16 @@ class ViewController: UIViewController {
private func prepareDateLabel() { private func prepareDateLabel() {
dateLabel = UILabel() dateLabel = UILabel()
dateLabel.font = RobotoFont.regular(with: 12) dateLabel.font = RobotoFont.regular(with: 12)
dateLabel.textColor = blueGrey.base dateLabel.textColor = Color.blueGrey.base
dateLabel.text = dateFormatter.string(from: Date.distantFuture) dateLabel.text = dateFormatter.string(from: Date.distantFuture)
} }
private func prepareFavoriteButton() { private func prepareFavoriteButton() {
favoriteButton = IconButton(image: Icon.favorite, tintColor: red.base) favoriteButton = IconButton(image: Icon.favorite, tintColor: Color.red.base)
} }
private func prepareMoreButton() { private func prepareMoreButton() {
moreButton = IconButton(image: Icon.cm.moreVertical, tintColor: blueGrey.base) moreButton = IconButton(image: Icon.cm.moreVertical, tintColor: Color.blueGrey.base)
} }
private func prepareAuthorView() { private func prepareAuthorView() {
...@@ -97,7 +97,7 @@ class ViewController: UIViewController { ...@@ -97,7 +97,7 @@ class ViewController: UIViewController {
toolbar.detail = "Build Beautiful Software" toolbar.detail = "Build Beautiful Software"
toolbar.detailLabel.textAlignment = .left toolbar.detailLabel.textAlignment = .left
toolbar.detailLabel.textColor = blueGrey.base toolbar.detailLabel.textColor = Color.blueGrey.base
} }
private func prepareContentView() { private func prepareContentView() {
......
...@@ -50,7 +50,7 @@ class ViewController: UIViewController { ...@@ -50,7 +50,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareImageView() prepareImageView()
prepareFavoriteButton() prepareFavoriteButton()
...@@ -70,19 +70,19 @@ class ViewController: UIViewController { ...@@ -70,19 +70,19 @@ class ViewController: UIViewController {
} }
private func prepareFavoriteButton() { private func prepareFavoriteButton() {
favoriteButton = FlatButton(image: Icon.favorite, tintColor: blueGrey.base) favoriteButton = FlatButton(image: Icon.favorite, tintColor: Color.blueGrey.base)
} }
private func prepareShareButton() { private func prepareShareButton() {
shareButton = FlatButton(image: Icon.cm.share, tintColor: blueGrey.base) shareButton = FlatButton(image: Icon.cm.share, tintColor: Color.blueGrey.base)
} }
private func prepareStarButton() { private func prepareStarButton() {
starButton = FlatButton(image: Icon.cm.star, tintColor: blueGrey.base) starButton = FlatButton(image: Icon.cm.star, tintColor: Color.blueGrey.base)
} }
private func prepareMoreButton() { private func prepareMoreButton() {
moreButton = IconButton(image: Icon.cm.moreHorizontal, tintColor: white) moreButton = IconButton(image: Icon.cm.moreHorizontal, tintColor: .white)
} }
private func prepareToolbar() { private func prepareToolbar() {
...@@ -90,10 +90,10 @@ class ViewController: UIViewController { ...@@ -90,10 +90,10 @@ class ViewController: UIViewController {
toolbar.backgroundColor = nil toolbar.backgroundColor = nil
toolbar.title = "CosmicMind" toolbar.title = "CosmicMind"
toolbar.titleLabel.textColor = white toolbar.titleLabel.textColor = .white
toolbar.detail = "Build Beautiful Software" toolbar.detail = "Build Beautiful Software"
toolbar.detailLabel.textColor = white toolbar.detailLabel.textColor = .white
} }
private func prepareContentView() { private func prepareContentView() {
......
...@@ -37,7 +37,7 @@ class ViewController: UIViewController { ...@@ -37,7 +37,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareLayer() prepareLayer()
} }
...@@ -50,7 +50,7 @@ class ViewController: UIViewController { ...@@ -50,7 +50,7 @@ class ViewController: UIViewController {
layer = Layer(frame: CGRect(x: (w - d) / 2, y: (h - d) / 2, width: d, height: d)) layer = Layer(frame: CGRect(x: (w - d) / 2, y: (h - d) / 2, width: d, height: d))
layer.depthPreset = .depth3 layer.depthPreset = .depth3
layer.shapePreset = .circle layer.shapePreset = .circle
layer.backgroundColor = white.cgColor layer.backgroundColor = Color.white.cgColor
layer.image = UIImage(named: "CosmicMind") layer.image = UIImage(named: "CosmicMind")
view.layer.addSublayer(layer) view.layer.addSublayer(layer)
......
...@@ -38,7 +38,7 @@ class AppMenuController: MenuController { ...@@ -38,7 +38,7 @@ class AppMenuController: MenuController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareMenu() prepareMenu()
} }
......
...@@ -38,7 +38,7 @@ class RootViewController: UIViewController { ...@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareAddButton() prepareAddButton()
prepareAudioLibraryButton() prepareAudioLibraryButton()
...@@ -69,14 +69,14 @@ class RootViewController: UIViewController { ...@@ -69,14 +69,14 @@ class RootViewController: UIViewController {
} }
private func prepareAddButton() { private func prepareAddButton() {
addButton = FabButton(image: Icon.cm.add, tintColor: white) addButton = FabButton(image: Icon.cm.add)
addButton.addTarget(self, action: #selector(handleToggleMenu), for: .touchUpInside) addButton.addTarget(self, action: #selector(handleToggleMenu), for: .touchUpInside)
} }
private func prepareAudioLibraryButton() { private func prepareAudioLibraryButton() {
audioLibraryMenuItem = MenuItem() audioLibraryMenuItem = MenuItem()
audioLibraryMenuItem.button.image = Icon.cm.audioLibrary audioLibraryMenuItem.button.image = Icon.cm.audioLibrary
audioLibraryMenuItem.button.backgroundColor = green.base audioLibraryMenuItem.button.backgroundColor = Color.green.base
audioLibraryMenuItem.button.depthPreset = .depth1 audioLibraryMenuItem.button.depthPreset = .depth1
audioLibraryMenuItem.title = "Audio Library" audioLibraryMenuItem.title = "Audio Library"
} }
...@@ -84,7 +84,7 @@ class RootViewController: UIViewController { ...@@ -84,7 +84,7 @@ class RootViewController: UIViewController {
private func prepareBellButton() { private func prepareBellButton() {
reminderMenuItem = MenuItem() reminderMenuItem = MenuItem()
reminderMenuItem.button.image = Icon.cm.bell reminderMenuItem.button.image = Icon.cm.bell
reminderMenuItem.button.backgroundColor = blue.base reminderMenuItem.button.backgroundColor = Color.blue.base
reminderMenuItem.title = "Reminders" reminderMenuItem.title = "Reminders"
} }
......
...@@ -34,8 +34,12 @@ import Material ...@@ -34,8 +34,12 @@ import Material
class AppNavigationController: NavigationController { class AppNavigationController: NavigationController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
guard let v = navigationBar as? NavigationBar else {
return
}
statusBarStyle = .lightContent statusBarStyle = .lightContent
(navigationBar as? NavigationBar)?.backgroundColor = blue.base v.backgroundColor = Color.blue.base
} }
} }
...@@ -34,19 +34,19 @@ import Material ...@@ -34,19 +34,19 @@ import Material
class NextViewController: UIViewController { class NextViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareNavigationItem() prepareNavigationItem()
} }
private func prepareNavigationItem() { private func prepareNavigationItem() {
navigationItem.title = "Title" navigationItem.title = "Title"
navigationItem.titleLabel.textColor = white navigationItem.titleLabel.textColor = .white
navigationItem.detail = "Detail Description" navigationItem.detail = "Detail Description"
navigationItem.detailLabel.textColor = lightBlue.lighten5 navigationItem.detailLabel.textColor = Color.lightBlue.lighten5
navigationItem.backButton.tintColor = white navigationItem.backButton.tintColor = .white
} }
} }
...@@ -42,7 +42,7 @@ class RootViewController: UIViewController { ...@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareMenuButton() prepareMenuButton()
prepareStarButton() prepareStarButton()
...@@ -56,23 +56,26 @@ class RootViewController: UIViewController { ...@@ -56,23 +56,26 @@ class RootViewController: UIViewController {
} }
private func prepareMenuButton() { private func prepareMenuButton() {
menuButton = IconButton(image: Icon.cm.menu, tintColor: white) menuButton = IconButton(image: Icon.cm.menu, tintColor: .white)
menuButton.pulseColor = .white
} }
private func prepareStarButton() { private func prepareStarButton() {
starButton = IconButton(image: Icon.cm.star, tintColor: white) starButton = IconButton(image: Icon.cm.star, tintColor: .white)
starButton.pulseColor = .white
} }
private func prepareSearchButton() { private func prepareSearchButton() {
searchButton = IconButton(image: Icon.cm.search, tintColor: white) searchButton = IconButton(image: Icon.cm.search, tintColor: .white)
searchButton.pulseColor = .white
} }
private func prepareNavigationItem() { private func prepareNavigationItem() {
navigationItem.title = "Material" navigationItem.title = "Material"
navigationItem.titleLabel.textColor = white navigationItem.titleLabel.textColor = .white
navigationItem.detail = "Build Beautiful Software" navigationItem.detail = "Build Beautiful Software"
navigationItem.detailLabel.textColor = lightBlue.lighten5 navigationItem.detailLabel.textColor = Color.lightBlue.lighten5
navigationItem.leftViews = [menuButton] navigationItem.leftViews = [menuButton]
navigationItem.rightViews = [starButton, searchButton] navigationItem.rightViews = [starButton, searchButton]
......
...@@ -36,7 +36,7 @@ class LeftViewController: UIViewController { ...@@ -36,7 +36,7 @@ class LeftViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
prepareTransitionButton() prepareTransitionButton()
} }
...@@ -55,7 +55,7 @@ class LeftViewController: UIViewController { ...@@ -55,7 +55,7 @@ class LeftViewController: UIViewController {
} }
private func prepareTransitionButton() { private func prepareTransitionButton() {
transitionButton = FlatButton(title: "Transition VC", titleColor: white) transitionButton = FlatButton(title: "Transition VC", titleColor: .white)
transitionButton.addTarget(self, action: #selector(handleTransitionButton), for: .touchUpInside) transitionButton.addTarget(self, action: #selector(handleTransitionButton), for: .touchUpInside)
view.layout(transitionButton).horizontally().center() view.layout(transitionButton).horizontally().center()
......
...@@ -36,7 +36,7 @@ class RightViewController: UIViewController { ...@@ -36,7 +36,7 @@ class RightViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
prepareRootButton() prepareRootButton()
} }
...@@ -55,7 +55,7 @@ class RightViewController: UIViewController { ...@@ -55,7 +55,7 @@ class RightViewController: UIViewController {
} }
private func prepareRootButton() { private func prepareRootButton() {
rootButton = FlatButton(title: "Root VC", titleColor: white) rootButton = FlatButton(title: "Root VC", titleColor: .white)
rootButton.addTarget(self, action: #selector(handleTransitionButton), for: .touchUpInside) rootButton.addTarget(self, action: #selector(handleTransitionButton), for: .touchUpInside)
view.layout(rootButton).horizontally().center() view.layout(rootButton).horizontally().center()
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class RootViewController: UIViewController { class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareToolbar() prepareToolbar()
} }
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class TransitionedViewController: UIViewController { class TransitionedViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = purple.base view.backgroundColor = Color.purple.base
prepareToolbar() prepareToolbar()
} }
......
...@@ -40,8 +40,8 @@ class AppPageTabBarController: PageTabBarController { ...@@ -40,8 +40,8 @@ class AppPageTabBarController: PageTabBarController {
} }
private func preparePageTabBar() { private func preparePageTabBar() {
pageTabBar.lineColor = blueGrey.base pageTabBar.lineColor = Color.blueGrey.base
pageTabBar.dividerColor = blueGrey.lighten5 pageTabBar.dividerColor = Color.blueGrey.lighten5
} }
} }
......
...@@ -44,12 +44,12 @@ class BlueViewController: UIViewController { ...@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Blue" pageTabBarItem.title = "Blue"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -44,12 +44,12 @@ class GreenViewController: UIViewController { ...@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = green.base view.backgroundColor = Color.green.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Green" pageTabBarItem.title = "Green"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -44,12 +44,12 @@ class RedViewController: UIViewController { ...@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = red.base view.backgroundColor = Color.red.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Red" pageTabBarItem.title = "Red"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -42,6 +42,6 @@ class AppToolbarController: ToolbarController { ...@@ -42,6 +42,6 @@ class AppToolbarController: ToolbarController {
private func prepareToolbar() { private func prepareToolbar() {
toolbar.title = "Photo Library" toolbar.title = "Photo Library"
toolbar.depthPreset = .none toolbar.depthPreset = .none
toolbar.dividerColor = grey.lighten3 toolbar.dividerColor = Color.grey.lighten3
} }
} }
...@@ -50,7 +50,7 @@ class PhotoLibraryCollectionReusableView: CollectionReusableView { ...@@ -50,7 +50,7 @@ class PhotoLibraryCollectionReusableView: CollectionReusableView {
toolbar.contentEdgeInsets.left = 16 toolbar.contentEdgeInsets.left = 16
toolbar.contentEdgeInsets.right = 16 toolbar.contentEdgeInsets.right = 16
toolbar.depthPreset = .none toolbar.depthPreset = .none
toolbar.dividerColor = grey.lighten3 toolbar.dividerColor = Color.grey.lighten3
layout(toolbar).edges() layout(toolbar).edges()
} }
} }
...@@ -73,7 +73,7 @@ class PhotoLibraryViewController: PhotoLibraryController { ...@@ -73,7 +73,7 @@ class PhotoLibraryViewController: PhotoLibraryController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
prepareCollectionView() prepareCollectionView()
......
...@@ -51,7 +51,7 @@ class ViewController: UIViewController { ...@@ -51,7 +51,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
preparePresenterView() preparePresenterView()
prepareDateFormatter() prepareDateFormatter()
...@@ -79,21 +79,21 @@ class ViewController: UIViewController { ...@@ -79,21 +79,21 @@ class ViewController: UIViewController {
private func prepareDateLabel() { private func prepareDateLabel() {
dateLabel = UILabel() dateLabel = UILabel()
dateLabel.font = RobotoFont.regular(with: 12) dateLabel.font = RobotoFont.regular(with: 12)
dateLabel.textColor = blueGrey.base dateLabel.textColor = Color.blueGrey.base
dateLabel.textAlignment = .center dateLabel.textAlignment = .center
dateLabel.text = dateFormatter.string(from: Date.distantFuture) dateLabel.text = dateFormatter.string(from: Date.distantFuture)
} }
private func prepareFavoriteButton() { private func prepareFavoriteButton() {
favoriteButton = IconButton(image: Icon.favorite, tintColor: red.base) favoriteButton = IconButton(image: Icon.favorite, tintColor: Color.red.base)
} }
private func prepareShareButton() { private func prepareShareButton() {
shareButton = IconButton(image: Icon.cm.share, tintColor: blueGrey.base) shareButton = IconButton(image: Icon.cm.share, tintColor: Color.blueGrey.base)
} }
private func prepareMoreButton() { private func prepareMoreButton() {
moreButton = IconButton(image: Icon.cm.moreHorizontal, tintColor: blueGrey.base) moreButton = IconButton(image: Icon.cm.moreHorizontal, tintColor: Color.blueGrey.base)
} }
private func prepareToolbar() { private func prepareToolbar() {
...@@ -104,7 +104,7 @@ class ViewController: UIViewController { ...@@ -104,7 +104,7 @@ class ViewController: UIViewController {
toolbar.detail = "Build Beautiful Software" toolbar.detail = "Build Beautiful Software"
toolbar.detailLabel.textAlignment = .left toolbar.detailLabel.textAlignment = .left
toolbar.detailLabel.textColor = blueGrey.base toolbar.detailLabel.textColor = Color.blueGrey.base
} }
private func prepareContentView() { private func prepareContentView() {
......
...@@ -37,7 +37,7 @@ class RootViewController: UIViewController { ...@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten1 view.backgroundColor = Color.grey.lighten1
} }
open override func viewWillAppear(_ animated: Bool) { open override func viewWillAppear(_ animated: Bool) {
......
...@@ -36,7 +36,7 @@ class RootViewController: UIViewController { ...@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
} }
open override func viewDidAppear(_ animated: Bool) { open override func viewDidAppear(_ animated: Bool) {
...@@ -49,7 +49,7 @@ class RootViewController: UIViewController { ...@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
} }
private func prepareUndoButton() { private func prepareUndoButton() {
undoButton = FlatButton(title: "Undo", titleColor: yellow.base) undoButton = FlatButton(title: "Undo", titleColor: Color.yellow.base)
undoButton.pulseAnimation = .backing undoButton.pulseAnimation = .backing
undoButton.titleLabel?.font = snackbarController?.snackbar.textLabel.font undoButton.titleLabel?.font = snackbarController?.snackbar.textLabel.font
} }
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class RootViewController: UIViewController { class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten1 view.backgroundColor = Color.grey.lighten1
} }
} }
...@@ -35,7 +35,7 @@ class ViewController: UIViewController { ...@@ -35,7 +35,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareSwitch() prepareSwitch()
} }
......
...@@ -40,22 +40,22 @@ class ViewController: UIViewController { ...@@ -40,22 +40,22 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareButtons() prepareButtons()
prepareTabBar() prepareTabBar()
} }
private func prepareButtons() { private func prepareButtons() {
let btn1 = FlatButton(title: "Library", titleColor: blueGrey.base) let btn1 = FlatButton(title: "Library", titleColor: Color.blueGrey.base)
btn1.pulseAnimation = .none btn1.pulseAnimation = .none
buttons.append(btn1) buttons.append(btn1)
let btn2 = FlatButton(title: "Photo", titleColor: blueGrey.base) let btn2 = FlatButton(title: "Photo", titleColor: Color.blueGrey.base)
btn2.pulseAnimation = .none btn2.pulseAnimation = .none
buttons.append(btn2) buttons.append(btn2)
let btn3 = FlatButton(title: "Video", titleColor: blueGrey.base) let btn3 = FlatButton(title: "Video", titleColor: Color.blueGrey.base)
btn3.pulseAnimation = .none btn3.pulseAnimation = .none
buttons.append(btn3) buttons.append(btn3)
} }
...@@ -63,13 +63,13 @@ class ViewController: UIViewController { ...@@ -63,13 +63,13 @@ class ViewController: UIViewController {
private func prepareTabBar() { private func prepareTabBar() {
tabBar = TabBar() tabBar = TabBar()
tabBar.dividerColor = grey.lighten3 tabBar.dividerColor = Color.grey.lighten3
tabBar.dividerAlignment = .top tabBar.dividerAlignment = .top
tabBar.lineColor = blue.base tabBar.lineColor = Color.blue.base
tabBar.lineAlignment = .top tabBar.lineAlignment = .top
tabBar.backgroundColor = grey.lighten5 tabBar.backgroundColor = Color.grey.lighten5
tabBar.buttons = buttons tabBar.buttons = buttons
view.layout(tabBar).horizontally().bottom() view.layout(tabBar).horizontally().bottom()
......
...@@ -38,7 +38,7 @@ class ViewController: UIViewController { ...@@ -38,7 +38,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareNameField() prepareNameField()
prepareEmailField() prepareEmailField()
...@@ -53,7 +53,7 @@ class ViewController: UIViewController { ...@@ -53,7 +53,7 @@ class ViewController: UIViewController {
/// Prepares the resign responder button. /// Prepares the resign responder button.
private func prepareResignResponderButton() { private func prepareResignResponderButton() {
let btn = RaisedButton(title: "Resign", titleColor: blue.base) let btn = RaisedButton(title: "Resign", titleColor: Color.blue.base)
btn.addTarget(self, action: #selector(handleResignResponderButton(button:)), for: .touchUpInside) btn.addTarget(self, action: #selector(handleResignResponderButton(button:)), for: .touchUpInside)
view.layout(btn).width(100).height(50).bottom(24).right(24) view.layout(btn).width(100).height(50).bottom(24).right(24)
...@@ -102,7 +102,7 @@ class ViewController: UIViewController { ...@@ -102,7 +102,7 @@ class ViewController: UIViewController {
passwordField.isVisibilityIconButtonEnabled = true passwordField.isVisibilityIconButtonEnabled = true
// Setting the visibilityIconButton color. // Setting the visibilityIconButton color.
passwordField.visibilityIconButton?.tintColor = green.base.withAlphaComponent(passwordField.isSecureTextEntry ? 0.38 : 0.54) passwordField.visibilityIconButton?.tintColor = Color.green.base.withAlphaComponent(passwordField.isSecureTextEntry ? 0.38 : 0.54)
// Size the TextField to the maximum width, less 40 pixels on either side // Size the TextField to the maximum width, less 40 pixels on either side
// with a top margin of 200 pixels. // with a top margin of 200 pixels.
......
...@@ -35,6 +35,8 @@ class AppToolbarController: ToolbarController { ...@@ -35,6 +35,8 @@ class AppToolbarController: ToolbarController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
statusBarStyle = .default statusBarStyle = .default
// toolbar.heightPreset = .large
toolbar.height = 100
} }
} }
...@@ -38,7 +38,7 @@ class RootViewController: UIViewController { ...@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
} }
open override func viewWillAppear(_ animated: Bool) { open override func viewWillAppear(_ animated: Bool) {
......
...@@ -37,7 +37,7 @@ class ViewController: UIViewController { ...@@ -37,7 +37,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = white view.backgroundColor = .white
prepareLogo() prepareLogo()
} }
...@@ -48,7 +48,7 @@ class ViewController: UIViewController { ...@@ -48,7 +48,7 @@ class ViewController: UIViewController {
logo = View() logo = View()
logo.depthPreset = .depth3 logo.depthPreset = .depth3
logo.shapePreset = .circle logo.shapePreset = .circle
logo.backgroundColor = white logo.backgroundColor = .white
logo.image = UIImage(named: "CosmicMind") logo.image = UIImage(named: "CosmicMind")
view.layout(logo).width(d).height(d).center() view.layout(logo).width(d).height(d).center()
......
...@@ -44,7 +44,7 @@ class AudioViewController: UIViewController { ...@@ -44,7 +44,7 @@ class AudioViewController: UIViewController {
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = nil tabBarItem.title = nil
tabBarItem.image = Icon.cm.audioLibrary?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.audioLibrary?.tint(with: .blueGrey.base)
tabBarItem.selectedImage = Icon.cm.audioLibrary?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.audioLibrary?.tint(with: .blue.base)
} }
} }
...@@ -44,7 +44,7 @@ class PhotoViewController: UIViewController { ...@@ -44,7 +44,7 @@ class PhotoViewController: UIViewController {
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = nil tabBarItem.title = nil
tabBarItem.image = Icon.cm.photoCamera?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.photoCamera?.tint(with: .blueGrey.base)
tabBarItem.selectedImage = Icon.cm.photoCamera?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.photoCamera?.tint(with: .blue.base)
} }
} }
...@@ -44,7 +44,7 @@ class RemindersViewController: UIViewController { ...@@ -44,7 +44,7 @@ class RemindersViewController: UIViewController {
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = nil tabBarItem.title = nil
tabBarItem.image = Icon.cm.bell?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.bell?.tint(with: .blueGrey.base)
tabBarItem.selectedImage = Icon.cm.bell?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.bell?.tint(with: .blue.base)
} }
} }
...@@ -44,7 +44,7 @@ class SearchViewController: UIViewController { ...@@ -44,7 +44,7 @@ class SearchViewController: UIViewController {
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = nil tabBarItem.title = nil
tabBarItem.image = Icon.cm.search?.tint(with: .blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.search?.tint(with: .blueGrey.base)
tabBarItem.selectedImage = Icon.cm.search?.tint(with: .blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.search?.tint(with: .blue.base)
} }
} }
...@@ -39,12 +39,12 @@ class VideoViewController: UIViewController { ...@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = green.base view.backgroundColor = Color.green.base
} }
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = nil tabBarItem.title = nil
tabBarItem.image = Icon.cm.videocam?.tint(with: blueGrey.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.image = Icon.cm.videocam?.tint(with: Color.blueGrey.base)
tabBarItem.selectedImage = Icon.cm.videocam?.tint(with: blue.base)?.withRenderingMode(.alwaysOriginal) tabBarItem.selectedImage = Icon.cm.videocam?.tint(with: Color.blue.base)
} }
} }
...@@ -47,7 +47,7 @@ class ViewController: UIViewController { ...@@ -47,7 +47,7 @@ class ViewController: UIViewController {
private func prepareIconButton() { private func prepareIconButton() {
iconButton.image = Icon.search iconButton.image = Icon.search
iconButton.pulseColor = blue.base iconButton.pulseColor = Color.blue.base
} }
} }
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class NextViewController: UIViewController { class NextViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.base view.backgroundColor = Color.grey.base
prepareNavigationItem() prepareNavigationItem()
} }
...@@ -43,7 +43,7 @@ class NextViewController: UIViewController { ...@@ -43,7 +43,7 @@ class NextViewController: UIViewController {
navigationItem.title = "Title" navigationItem.title = "Title"
navigationItem.detail = "Detail Description" navigationItem.detail = "Detail Description"
navigationItem.backButton.tintColor = blue.base navigationItem.backButton.tintColor = Color.blue.base
} }
} }
...@@ -42,7 +42,7 @@ class RootViewController: UIViewController { ...@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten1 view.backgroundColor = Color.grey.lighten1
prepareMenuButton() prepareMenuButton()
prepareStarButton() prepareStarButton()
......
...@@ -34,6 +34,6 @@ import Material ...@@ -34,6 +34,6 @@ import Material
class LeftViewController: UIViewController { class LeftViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
} }
} }
...@@ -34,6 +34,6 @@ import Material ...@@ -34,6 +34,6 @@ import Material
class RightViewController: UIViewController { class RightViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
} }
} }
...@@ -40,7 +40,7 @@ class AppPageTabBarController: PageTabBarController { ...@@ -40,7 +40,7 @@ class AppPageTabBarController: PageTabBarController {
} }
private func preparePageTabBar() { private func preparePageTabBar() {
pageTabBar.lineColor = grey.darken1 pageTabBar.lineColor = Color.grey.darken1
} }
} }
......
...@@ -44,12 +44,12 @@ class BlueViewController: UIViewController { ...@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = blue.base view.backgroundColor = Color.blue.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Blue" pageTabBarItem.title = "Blue"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -44,12 +44,12 @@ class GreenViewController: UIViewController { ...@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = green.base view.backgroundColor = Color.green.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Green" pageTabBarItem.title = "Green"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -44,12 +44,12 @@ class RedViewController: UIViewController { ...@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = red.base view.backgroundColor = Color.red.base
} }
private func preparePageTabBarItem() { private func preparePageTabBarItem() {
pageTabBarItem.title = "Red" pageTabBarItem.title = "Red"
pageTabBarItem.titleColor = blueGrey.base pageTabBarItem.titleColor = Color.blueGrey.base
} }
} }
...@@ -37,7 +37,7 @@ class RootViewController: UIViewController { ...@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten1 view.backgroundColor = Color.grey.lighten1
} }
open override func viewWillAppear(_ animated: Bool) { open override func viewWillAppear(_ animated: Bool) {
......
...@@ -36,7 +36,7 @@ class RootViewController: UIViewController { ...@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
} }
open override func viewDidAppear(_ animated: Bool) { open override func viewDidAppear(_ animated: Bool) {
...@@ -49,7 +49,7 @@ class RootViewController: UIViewController { ...@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
} }
private func prepareUndoButton() { private func prepareUndoButton() {
undoButton = FlatButton(title: "Undo", titleColor: yellow.base) undoButton = FlatButton(title: "Undo", titleColor: Color.yellow.base)
undoButton.pulseAnimation = .backing undoButton.pulseAnimation = .backing
undoButton.titleLabel?.font = snackbarController?.snackbar.textLabel.font undoButton.titleLabel?.font = snackbarController?.snackbar.textLabel.font
} }
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class RootViewController: UIViewController { class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = grey.lighten5 view.backgroundColor = Color.grey.lighten5
} }
} }
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
96230AB81D6A520C00AF47DC /* Divider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96230AB71D6A520C00AF47DC /* Divider.swift */; }; 96230AB81D6A520C00AF47DC /* Divider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96230AB71D6A520C00AF47DC /* Divider.swift */; };
9626CA971DAB53A8003E2611 /* Display.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626CA961DAB53A8003E2611 /* Display.swift */; }; 9626CA971DAB53A8003E2611 /* Display.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626CA961DAB53A8003E2611 /* Display.swift */; };
9626CA9E1DAB55B8003E2611 /* CaptureController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626CA9D1DAB55B8003E2611 /* CaptureController.swift */; }; 9626CA9E1DAB55B8003E2611 /* CaptureController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626CA9D1DAB55B8003E2611 /* CaptureController.swift */; };
9626CB9B1DAD3D1D003E2611 /* HeightPreset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626CB9A1DAD3D1D003E2611 /* HeightPreset.swift */; };
9628645A1D53FE3E00690B69 /* Material+UIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864591D53FE3E00690B69 /* Material+UIWindow.swift */; }; 9628645A1D53FE3E00690B69 /* Material+UIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962864591D53FE3E00690B69 /* Material+UIWindow.swift */; };
9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9628645E1D540AF300690B69 /* DynamicFontType.swift */; }; 9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9628645E1D540AF300690B69 /* DynamicFontType.swift */; };
9631A7C11D95E3AC00CFB109 /* PresenterCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9631A7C01D95E3AC00CFB109 /* PresenterCard.swift */; }; 9631A7C11D95E3AC00CFB109 /* PresenterCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9631A7C01D95E3AC00CFB109 /* PresenterCard.swift */; };
...@@ -213,6 +214,7 @@ ...@@ -213,6 +214,7 @@
96230AB71D6A520C00AF47DC /* Divider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Divider.swift; sourceTree = "<group>"; }; 96230AB71D6A520C00AF47DC /* Divider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Divider.swift; sourceTree = "<group>"; };
9626CA961DAB53A8003E2611 /* Display.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Display.swift; sourceTree = "<group>"; }; 9626CA961DAB53A8003E2611 /* Display.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Display.swift; sourceTree = "<group>"; };
9626CA9D1DAB55B8003E2611 /* CaptureController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureController.swift; sourceTree = "<group>"; }; 9626CA9D1DAB55B8003E2611 /* CaptureController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureController.swift; sourceTree = "<group>"; };
9626CB9A1DAD3D1D003E2611 /* HeightPreset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeightPreset.swift; sourceTree = "<group>"; };
962864591D53FE3E00690B69 /* Material+UIWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIWindow.swift"; sourceTree = "<group>"; }; 962864591D53FE3E00690B69 /* Material+UIWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Material+UIWindow.swift"; sourceTree = "<group>"; };
9628645E1D540AF300690B69 /* DynamicFontType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DynamicFontType.swift; sourceTree = "<group>"; }; 9628645E1D540AF300690B69 /* DynamicFontType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DynamicFontType.swift; sourceTree = "<group>"; };
9631A7C01D95E3AC00CFB109 /* PresenterCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresenterCard.swift; sourceTree = "<group>"; }; 9631A7C01D95E3AC00CFB109 /* PresenterCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresenterCard.swift; sourceTree = "<group>"; };
...@@ -385,6 +387,14 @@ ...@@ -385,6 +387,14 @@
name = Root; name = Root;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9626CBCC1DADA5F1003E2611 /* Height */ = {
isa = PBXGroup;
children = (
9626CB9A1DAD3D1D003E2611 /* HeightPreset.swift */,
);
name = Height;
sourceTree = "<group>";
};
962DDD071D6FBBB7001C307C /* Page */ = { 962DDD071D6FBBB7001C307C /* Page */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -542,6 +552,7 @@ ...@@ -542,6 +552,7 @@
96BCB80A1CB410A100C806FE /* Extension */, 96BCB80A1CB410A100C806FE /* Extension */,
96BCB8071CB4101C00C806FE /* Font */, 96BCB8071CB4101C00C806FE /* Font */,
9602F00C1DA1163000F3FB79 /* Grid */, 9602F00C1DA1163000F3FB79 /* Grid */,
9626CBCC1DADA5F1003E2611 /* Height */,
96BCB8081CB4105E00C806FE /* Icon */, 96BCB8081CB4105E00C806FE /* Icon */,
96BCB80D1CB410FD00C806FE /* Layer */, 96BCB80D1CB410FD00C806FE /* Layer */,
96BCB8041CB40F6C00C806FE /* Layout */, 96BCB8041CB40F6C00C806FE /* Layout */,
...@@ -1074,6 +1085,7 @@ ...@@ -1074,6 +1085,7 @@
96BCB7C71CB40DC500C806FE /* KeyframeAnimation.swift in Sources */, 96BCB7C71CB40DC500C806FE /* KeyframeAnimation.swift in Sources */,
96BCB7BE1CB40DC500C806FE /* CollectionViewLayout.swift in Sources */, 96BCB7BE1CB40DC500C806FE /* CollectionViewLayout.swift in Sources */,
96BCB7BF1CB40DC500C806FE /* Color.swift in Sources */, 96BCB7BF1CB40DC500C806FE /* Color.swift in Sources */,
9626CB9B1DAD3D1D003E2611 /* HeightPreset.swift in Sources */,
96EA9A431D4E68F80052C74D /* PhotoLibrary.swift in Sources */, 96EA9A431D4E68F80052C74D /* PhotoLibrary.swift in Sources */,
96BCB7C61CB40DC500C806FE /* Icon.swift in Sources */, 96BCB7C61CB40DC500C806FE /* Icon.swift in Sources */,
96BCB7E91CB40DC500C806FE /* ToolbarController.swift in Sources */, 96BCB7E91CB40DC500C806FE /* ToolbarController.swift in Sources */,
......
...@@ -37,6 +37,15 @@ public enum ContentViewAlignment: Int { ...@@ -37,6 +37,15 @@ public enum ContentViewAlignment: Int {
} }
open class Bar: View { open class Bar: View {
/// Will render the view.
open var willLayout: Bool {
return 0 < width && 0 < height && nil != superview
}
open override var intrinsicContentSize: CGSize {
return CGSize(width: width, height: height)
}
/// Should center the contentView. /// Should center the contentView.
open var contentViewAlignment = ContentViewAlignment.any { open var contentViewAlignment = ContentViewAlignment.any {
didSet { didSet {
...@@ -44,11 +53,6 @@ open class Bar: View { ...@@ -44,11 +53,6 @@ open class Bar: View {
} }
} }
/// Will render the view.
open var willLayout: Bool {
return 0 < width && 0 < height && nil != superview
}
/// A preset wrapper around contentEdgeInsets. /// A preset wrapper around contentEdgeInsets.
open var contentEdgeInsetsPreset: EdgeInsetsPreset { open var contentEdgeInsetsPreset: EdgeInsetsPreset {
get { get {
...@@ -88,10 +92,6 @@ open class Bar: View { ...@@ -88,10 +92,6 @@ open class Bar: View {
} }
} }
open override var intrinsicContentSize: CGSize {
return CGSize(width: width, height: 44)
}
/// Grid cell factor. /// Grid cell factor.
@IBInspectable @IBInspectable
open var gridFactor: CGFloat = 12 { open var gridFactor: CGFloat = 12 {
...@@ -130,6 +130,9 @@ open class Bar: View { ...@@ -130,6 +130,9 @@ open class Bar: View {
return contentView.grid.views return contentView.grid.views
} }
set(value) { set(value) {
for v in contentView.grid.views {
v.removeFromSuperview()
}
contentView.grid.views = value contentView.grid.views = value
} }
} }
...@@ -250,6 +253,7 @@ open class Bar: View { ...@@ -250,6 +253,7 @@ open class Bar: View {
*/ */
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
heightPreset = .default
autoresizingMask = .flexibleWidth autoresizingMask = .flexibleWidth
interimSpacePreset = .interimSpace3 interimSpacePreset = .interimSpace3
contentEdgeInsetsPreset = .square1 contentEdgeInsetsPreset = .square1
......
...@@ -158,7 +158,8 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel ...@@ -158,7 +158,8 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
/// Prepares the tabBar. /// Prepares the tabBar.
private func prepareTabBar() { private func prepareTabBar() {
tabBar.depthPreset = .depth1 tabBar.heightPreset = .normal
tabBar.depthPreset = .depth1
tabBar.dividerAlignment = .top tabBar.dividerAlignment = .top
let image = UIImage.image(with: Color.clear, size: CGSize(width: 1, height: 1)) let image = UIImage.image(with: Color.clear, size: CGSize(width: 1, height: 1))
tabBar.shadowImage = image tabBar.shadowImage = image
......
...@@ -38,6 +38,10 @@ extension UITabBarItem { ...@@ -38,6 +38,10 @@ extension UITabBarItem {
} }
open class BottomTabBar: UITabBar { open class BottomTabBar: UITabBar {
open override var intrinsicContentSize: CGSize {
return CGSize(width: width, height: height)
}
/// Automatically aligns the BottomNavigationBar to the superview. /// Automatically aligns the BottomNavigationBar to the superview.
open var isAlignedToParentAutomatically = true open var isAlignedToParentAutomatically = true
...@@ -124,7 +128,8 @@ open class BottomTabBar: UITabBar { ...@@ -124,7 +128,8 @@ open class BottomTabBar: UITabBar {
when subclassing. when subclassing.
*/ */
public func prepare() { public func prepare() {
depthPreset = .depth1 heightPreset = .normal
depthPreset = .depth1
dividerAlignment = .top dividerAlignment = .top
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
backgroundColor = .white backgroundColor = .white
......
...@@ -150,6 +150,7 @@ open class Button: UIButton { ...@@ -150,6 +150,7 @@ open class Button: UIButton {
public convenience init(image: UIImage?, tintColor: UIColor = Color.blue.base) { public convenience init(image: UIImage?, tintColor: UIColor = Color.blue.base) {
self.init() self.init()
prepare(with: image, tintColor: tintColor) prepare(with: image, tintColor: tintColor)
prepare()
} }
/** /**
...@@ -160,6 +161,7 @@ open class Button: UIButton { ...@@ -160,6 +161,7 @@ open class Button: UIButton {
public convenience init(title: String?, titleColor: UIColor = Color.blue.base) { public convenience init(title: String?, titleColor: UIColor = Color.blue.base) {
self.init() self.init()
prepare(with: title, titleColor: titleColor) prepare(with: title, titleColor: titleColor)
prepare()
} }
open override func layoutSublayers(of layer: CALayer) { open override func layoutSublayers(of layer: CALayer) {
...@@ -259,7 +261,6 @@ open class Button: UIButton { ...@@ -259,7 +261,6 @@ open class Button: UIButton {
private func prepare(with image: UIImage?, tintColor: UIColor) { private func prepare(with image: UIImage?, tintColor: UIColor) {
self.image = image self.image = image
self.tintColor = tintColor self.tintColor = tintColor
pulseColor = tintColor
} }
/** /**
...@@ -270,6 +271,5 @@ open class Button: UIButton { ...@@ -270,6 +271,5 @@ open class Button: UIButton {
private func prepare(with title: String?, titleColor: UIColor) { private func prepare(with title: String?, titleColor: UIColor) {
self.title = title self.title = title
self.titleColor = titleColor self.titleColor = titleColor
pulseColor = titleColor
} }
} }
...@@ -59,18 +59,18 @@ public protocol ColorPalette { ...@@ -59,18 +59,18 @@ public protocol ColorPalette {
open class Color: UIColor { open class Color: UIColor {
// dark text // dark text
open class darkText { open class darkText {
open static let primary = black.withAlphaComponent(0.87) open static let primary = Color.black.withAlphaComponent(0.87)
open static let secondary = black.withAlphaComponent(0.54) open static let secondary = Color.black.withAlphaComponent(0.54)
open static let others = black.withAlphaComponent(0.38) open static let others = Color.black.withAlphaComponent(0.38)
open static let dividers = black.withAlphaComponent(0.12) open static let dividers = Color.black.withAlphaComponent(0.12)
} }
// light text // light text
open class lightText { open class lightText {
open static let primary = white open static let primary = Color.white
open static let secondary = white.withAlphaComponent(0.7) open static let secondary = Color.white.withAlphaComponent(0.7)
open static let others = white.withAlphaComponent(0.5) open static let others = Color.white.withAlphaComponent(0.5)
open static let dividers = white.withAlphaComponent(0.12) open static let dividers = Color.white.withAlphaComponent(0.12)
} }
// red // red
......
...@@ -48,7 +48,7 @@ open class Divider { ...@@ -48,7 +48,7 @@ open class Divider {
/// A reference to the height. /// A reference to the height.
public var height: CGFloat public var height: CGFloat
/// A UI /// A UIColor.
open var color: UIColor? { open var color: UIColor? {
get { get {
return line?.backgroundColor return line?.backgroundColor
......
...@@ -293,4 +293,25 @@ extension UIView { ...@@ -293,4 +293,25 @@ extension UIView {
AssociateObject(base: self, key: &GridKey, value: value) AssociateObject(base: self, key: &GridKey, value: value)
} }
} }
/// A reference to grid's layoutEdgeInsetsPreset.
open var layoutEdgeInsetsPreset: EdgeInsetsPreset {
get {
return grid.layoutEdgeInsetsPreset
}
set(value) {
grid.layoutEdgeInsetsPreset = value
}
}
/// A reference to grid's layoutEdgeInsets.
@IBInspectable
open var layoutEdgeInsets: EdgeInsets {
get {
return grid.layoutEdgeInsets
}
set(value) {
grid.layoutEdgeInsets = value
}
}
} }
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
@objc(HeightPreset)
public enum HeightPreset: Int {
case tiny = 20
case xsmall = 28
case small = 36
case `default` = 44
case normal = 49
case medium = 52
case large = 60
case xlarge = 68
}
...@@ -34,25 +34,24 @@ internal class MaterialLayer { ...@@ -34,25 +34,24 @@ internal class MaterialLayer {
/// A reference to the CALayer. /// A reference to the CALayer.
internal weak var layer: CALayer? internal weak var layer: CALayer?
/// A property that sets the height of the layer's frame.
internal var heightPreset = HeightPreset.default {
didSet {
layer?.height = CGFloat(heightPreset.rawValue)
}
}
/// A property that sets the cornerRadius of the backing layer. /// A property that sets the cornerRadius of the backing layer.
internal var cornerRadiusPreset = CornerRadiusPreset.none { internal var cornerRadiusPreset = CornerRadiusPreset.none {
didSet { didSet {
guard let v = layer else { layer?.cornerRadius = CornerRadiusPresetToValue(preset: cornerRadiusPreset)
return
}
v.cornerRadius = CornerRadiusPresetToValue(preset: cornerRadiusPreset)
} }
} }
/// A preset property to set the borderWidth. /// A preset property to set the borderWidth.
internal var borderWidthPreset = BorderWidthPreset.none { internal var borderWidthPreset = BorderWidthPreset.none {
didSet { didSet {
guard let v = layer else { layer?.borderWidth = BorderWidthPresetToValue(preset: borderWidthPreset)
return
}
v.borderWidth = BorderWidthPresetToValue(preset: borderWidthPreset)
} }
} }
...@@ -174,6 +173,16 @@ extension CALayer { ...@@ -174,6 +173,16 @@ extension CALayer {
} }
} }
/// HeightPreset value.
open var heightPreset: HeightPreset {
get {
return materialLayer.heightPreset
}
set(value) {
materialLayer.heightPreset = value
}
}
/** /**
A property that manages the overall shape for the object. If either the A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted width or height property is set, the other will be automatically adjusted
......
...@@ -116,9 +116,9 @@ extension UIImage { ...@@ -116,9 +116,9 @@ extension UIImage {
color.setFill() color.setFill()
context.fill(rect) context.fill(rect)
let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()! let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image?.withRenderingMode(.alwaysOriginal)
} }
} }
...@@ -136,7 +136,7 @@ extension UIImage { ...@@ -136,7 +136,7 @@ extension UIImage {
UIRectFill(rect) UIRectFill(rect)
let image = UIGraphicsGetImageFromCurrentImageContext() let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image?.withRenderingMode(.alwaysOriginal)
} }
} }
......
...@@ -76,6 +76,16 @@ extension UIView { ...@@ -76,6 +76,16 @@ extension UIView {
} }
} }
/// HeightPreset value.
open var heightPreset: HeightPreset {
get {
return layer.heightPreset
}
set(value) {
layer.heightPreset = value
}
}
/** /**
A property that manages the overall shape for the object. If either the A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted width or height property is set, the other will be automatically adjusted
......
...@@ -30,35 +30,15 @@ ...@@ -30,35 +30,15 @@
import UIKit import UIKit
/// NavigationBar styles.
@objc(NavigationBarStyle)
public enum NavigationBarStyle: Int {
case small
case medium
case large
}
open class NavigationBar: UINavigationBar { open class NavigationBar: UINavigationBar {
open override var intrinsicContentSize: CGSize { /// Will render the view.
switch navigationBarStyle { open var willLayout: Bool {
case .small: return 0 < width && 0 < height && nil != superview
return CGSize(width: Device.width, height: 32)
case .medium:
return CGSize(width: Device.width, height: 44)
case .large:
return CGSize(width: Device.width, height: 56)
}
} }
/// NavigationBarStyle value. open override var intrinsicContentSize: CGSize {
open var navigationBarStyle = NavigationBarStyle.medium return CGSize(width: width, height: height)
}
internal var animating = false
/// Will render the view.
open var willLayout: Bool {
return 0 < width && 0 < height && nil != superview
}
/// A preset wrapper around contentEdgeInsets. /// A preset wrapper around contentEdgeInsets.
open var contentEdgeInsetsPreset = EdgeInsetsPreset.none { open var contentEdgeInsetsPreset = EdgeInsetsPreset.none {
...@@ -301,6 +281,7 @@ open class NavigationBar: UINavigationBar { ...@@ -301,6 +281,7 @@ open class NavigationBar: UINavigationBar {
when subclassing. when subclassing.
*/ */
open func prepare() { open func prepare() {
heightPreset = .default
barStyle = .black barStyle = .black
isTranslucent = false isTranslucent = false
depthPreset = .depth1 depthPreset = .depth1
......
...@@ -208,6 +208,9 @@ extension UINavigationItem { ...@@ -208,6 +208,9 @@ extension UINavigationItem {
return navigationItem.contentView.grid.views return navigationItem.contentView.grid.views
} }
set(value) { set(value) {
for v in navigationItem.contentView.grid.views {
v.removeFromSuperview()
}
navigationItem.contentView.grid.views = value navigationItem.contentView.grid.views = value
} }
} }
......
...@@ -146,11 +146,11 @@ open class PageTabBarController: RootController { ...@@ -146,11 +146,11 @@ open class PageTabBarController: RootController {
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
let p = pageTabBar.intrinsicContentSize.height + pageTabBar.grid.layoutEdgeInsets.top + pageTabBar.grid.layoutEdgeInsets.bottom let p = pageTabBar.intrinsicContentSize.height + pageTabBar.layoutEdgeInsets.top + pageTabBar.layoutEdgeInsets.bottom
let y = view.height - p let y = view.height - p
pageTabBar.height = p pageTabBar.height = p
pageTabBar.width = view.width + pageTabBar.grid.layoutEdgeInsets.left + pageTabBar.grid.layoutEdgeInsets.right pageTabBar.width = view.width + pageTabBar.layoutEdgeInsets.left + pageTabBar.layoutEdgeInsets.right
rootViewController.view.height = y rootViewController.view.height = y
......
...@@ -34,8 +34,8 @@ internal struct Pulse { ...@@ -34,8 +34,8 @@ internal struct Pulse {
/// An Array of layers. /// An Array of layers.
internal lazy var layers = [CAShapeLayer]() internal lazy var layers = [CAShapeLayer]()
/// A UI /// A UIColor.
internal var color = Color.blueGrey.base internal var color = Color.grey.base
/// A reference to the PulseAnimation. /// A reference to the PulseAnimation.
internal var animation = PulseAnimation.pointWithBacking internal var animation = PulseAnimation.pointWithBacking
......
...@@ -56,11 +56,11 @@ open class SearchBarController: RootController { ...@@ -56,11 +56,11 @@ open class SearchBarController: RootController {
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
searchBar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20 searchBar.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20
let p = searchBar.intrinsicContentSize.height + searchBar.grid.layoutEdgeInsets.top + searchBar.grid.layoutEdgeInsets.bottom let p = searchBar.intrinsicContentSize.height + searchBar.layoutEdgeInsets.top + searchBar.layoutEdgeInsets.bottom
searchBar.width = view.width + searchBar.grid.layoutEdgeInsets.left + searchBar.grid.layoutEdgeInsets.right searchBar.width = view.width + searchBar.layoutEdgeInsets.left + searchBar.layoutEdgeInsets.right
searchBar.height = p searchBar.height = p
rootViewController.view.y = p rootViewController.view.y = p
......
...@@ -163,7 +163,7 @@ open class SnackbarController: RootController { ...@@ -163,7 +163,7 @@ open class SnackbarController: RootController {
/// Reloads the view. /// Reloads the view.
open func reload() { open func reload() {
snackbar.width = view.width snackbar.width = view.width
snackbar.height = snackbar.intrinsicContentSize.height + snackbar.grid.layoutEdgeInsets.top + snackbar.grid.layoutEdgeInsets.bottom snackbar.height = snackbar.intrinsicContentSize.height + snackbar.layoutEdgeInsets.top + snackbar.layoutEdgeInsets.bottom
layoutSnackbar(status: snackbar.status) layoutSnackbar(status: snackbar.status)
} }
......
...@@ -64,10 +64,6 @@ open class TabBar: Bar { ...@@ -64,10 +64,6 @@ open class TabBar: Bar {
/// A delegation reference. /// A delegation reference.
open weak var delegate: TabBarDelegate? open weak var delegate: TabBarDelegate?
open override var intrinsicContentSize: CGSize {
return CGSize(width: width, height: 49)
}
/// The currently selected button. /// The currently selected button.
open internal(set) var selected: UIButton? open internal(set) var selected: UIButton?
...@@ -206,6 +202,7 @@ open class TabBar: Bar { ...@@ -206,6 +202,7 @@ open class TabBar: Bar {
*/ */
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
heightPreset = .normal
contentEdgeInsetsPreset = .none contentEdgeInsetsPreset = .none
interimSpacePreset = .none interimSpacePreset = .none
prepareLine() prepareLine()
......
...@@ -68,7 +68,7 @@ public protocol ToolbarControllerDelegate { ...@@ -68,7 +68,7 @@ public protocol ToolbarControllerDelegate {
} }
@objc(ToolbarController) @objc(ToolbarController)
open class ToolbarController: RootController { open class ToolbarController: StatusBarController {
open var display = Display.partial { open var display = Display.partial {
didSet { didSet {
layoutSubviews() layoutSubviews()
...@@ -167,12 +167,10 @@ open class ToolbarController: RootController { ...@@ -167,12 +167,10 @@ open class ToolbarController: RootController {
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
toolbar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20 toolbar.y = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20
toolbar.width = view.width
let p = toolbar.intrinsicContentSize.height + toolbar.grid.layoutEdgeInsets.top + toolbar.grid.layoutEdgeInsets.bottom let p = toolbar.y + toolbar.height
toolbar.width = view.width + toolbar.grid.layoutEdgeInsets.left + toolbar.grid.layoutEdgeInsets.right
toolbar.height = p
switch display { switch display {
case .partial: case .partial:
......
...@@ -56,30 +56,21 @@ public protocol ColorPalette { ...@@ -56,30 +56,21 @@ public protocol ColorPalette {
optional static var accent4: NSColor { get } optional static var accent4: NSColor { get }
} }
open class Color { open class Color: NSColor {
// clear
open static let clear = NSclear
// white
open static let white = NSwhite
// black
open static let black = NSblack
// dark text // dark text
open class darkText { open class darkText {
open static let primary = black.withAlphaComponent(0.87) open static let primary = Color.black.withAlphaComponent(0.87)
open static let secondary = black.withAlphaComponent(0.54) open static let secondary = Color.black.withAlphaComponent(0.54)
open static let others = black.withAlphaComponent(0.38) open static let others = Color.black.withAlphaComponent(0.38)
open static let dividers = black.withAlphaComponent(0.12) open static let dividers = Color.black.withAlphaComponent(0.12)
} }
// light text // light text
open class lightText { open class lightText {
open static let primary = white open static let primary = Color.white
open static let secondary = white.withAlphaComponent(0.7) open static let secondary = Color.white.withAlphaComponent(0.7)
open static let others = white.withAlphaComponent(0.5) open static let others = Color.white.withAlphaComponent(0.5)
open static let dividers = white.withAlphaComponent(0.12) open static let dividers = Color.white.withAlphaComponent(0.12)
} }
// red // red
......
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