Commit f00e3eee by Daniel Dahan

updated Sample projects with latest pulse and divider property access

parent aaab03b5
...@@ -60,7 +60,7 @@ class ViewController: UIViewController { ...@@ -60,7 +60,7 @@ class ViewController: UIViewController {
private func prepareMenuButton() { private func prepareMenuButton() {
menuButton = IconButton(image: Icon.cm.menu, tintColor: Color.white) menuButton = IconButton(image: Icon.cm.menu, tintColor: Color.white)
menuButton.pulse.color = Color.white menuButton.pulseColor = Color.white
} }
private func prepareFavoriteButton() { private func prepareFavoriteButton() {
......
...@@ -84,7 +84,7 @@ public class ViewController: UIViewController { ...@@ -84,7 +84,7 @@ public class ViewController: UIViewController {
captureButton = FabButton() captureButton = FabButton()
captureButton.width = 72 captureButton.width = 72
captureButton.height = 72 captureButton.height = 72
captureButton.pulse.color = Color.white captureButton.pulseColor = Color.white
captureButton.backgroundColor = Color.red.darken1.withAlphaComponent(0.3) captureButton.backgroundColor = Color.red.darken1.withAlphaComponent(0.3)
captureButton.borderColor = Color.white captureButton.borderColor = Color.white
captureButton.borderWidthPreset = .border3 captureButton.borderWidthPreset = .border3
...@@ -97,7 +97,7 @@ public class ViewController: UIViewController { ...@@ -97,7 +97,7 @@ public class ViewController: UIViewController {
cameraButton = IconButton(image: Icon.cm.photoCamera, tintColor: Color.white) cameraButton = IconButton(image: Icon.cm.photoCamera, tintColor: Color.white)
cameraButton.width = 72 cameraButton.width = 72
cameraButton.height = 72 cameraButton.height = 72
cameraButton.pulse.animation = .centerRadialBeyondBounds cameraButton.pulseAnimation = .centerRadialBeyondBounds
cameraButton.shapePreset = .circle cameraButton.shapePreset = .circle
capture.cameraButton = cameraButton capture.cameraButton = cameraButton
...@@ -107,7 +107,7 @@ public class ViewController: UIViewController { ...@@ -107,7 +107,7 @@ public class ViewController: UIViewController {
videoButton = IconButton(image: Icon.cm.videocam, tintColor: Color.white) videoButton = IconButton(image: Icon.cm.videocam, tintColor: Color.white)
videoButton.width = 72 videoButton.width = 72
videoButton.height = 72 videoButton.height = 72
videoButton.pulse.animation = .centerRadialBeyondBounds videoButton.pulseAnimation = .centerRadialBeyondBounds
videoButton.shapePreset = .circle videoButton.shapePreset = .circle
capture.videoButton = videoButton capture.videoButton = videoButton
......
...@@ -33,27 +33,27 @@ import Material ...@@ -33,27 +33,27 @@ import Material
class ViewController: UIViewController { class ViewController: UIViewController {
/// A reference to the Layer. /// A reference to the Layer.
private var logo: Layer! private var layer: Layer!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.white view.backgroundColor = Color.white
prepareLogo() prepareLayer()
} }
private func prepareLogo() { private func prepareLayer() {
let w = view.width let w = view.width
let h = view.height let h = view.height
let d: CGFloat = 100 let d: CGFloat = 100
logo = 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))
logo.depthPreset = .depth3 layer.depthPreset = .depth3
logo.shapePreset = .circle layer.shapePreset = .circle
logo.backgroundColor = Color.white.cgColor layer.backgroundColor = Color.white.cgColor
logo.image = UIImage(named: "CosmicMind") layer.image = UIImage(named: "CosmicMind")
view.layer.addSublayer(logo) view.layer.addSublayer(layer)
} }
} }
...@@ -43,7 +43,7 @@ class RootViewController: UIViewController { ...@@ -43,7 +43,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.grey.lighten1 view.backgroundColor = Color.grey.lighten5
prepareAddButton() prepareAddButton()
prepareAudioLibraryButton() prepareAudioLibraryButton()
......
...@@ -34,7 +34,8 @@ import Material ...@@ -34,7 +34,8 @@ import Material
class AppNavigationController: NavigationController { class AppNavigationController: NavigationController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
statusBarStyle = .default statusBarStyle = .lightContent
(navigationBar as? NavigationBar)?.backgroundColor = Color.blue.base
} }
} }
...@@ -34,16 +34,19 @@ import Material ...@@ -34,16 +34,19 @@ import Material
class NextViewController: UIViewController { class NextViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.grey.base view.backgroundColor = Color.white
prepareNavigationItem() prepareNavigationItem()
} }
private func prepareNavigationItem() { private func prepareNavigationItem() {
navigationItem.title = "Title" navigationItem.title = "Title"
navigationItem.titleLabel.textColor = Color.white
navigationItem.detail = "Detail Description" navigationItem.detail = "Detail Description"
navigationItem.detailLabel.textColor = Color.lightBlue.lighten5
navigationItem.backButton.tintColor = Color.blue.base navigationItem.backButton.tintColor = Color.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 = Color.grey.lighten1 view.backgroundColor = Color.grey.lighten5
prepareMenuButton() prepareMenuButton()
prepareStarButton() prepareStarButton()
...@@ -56,20 +56,26 @@ class RootViewController: UIViewController { ...@@ -56,20 +56,26 @@ class RootViewController: UIViewController {
} }
private func prepareMenuButton() { private func prepareMenuButton() {
menuButton = IconButton(image: Icon.cm.menu, tintColor: Color.blue.base) menuButton = IconButton(image: Icon.cm.menu, tintColor: Color.white)
menuButton.pulseColor = Color.white
} }
private func prepareStarButton() { private func prepareStarButton() {
starButton = IconButton(image: Icon.cm.star, tintColor: Color.blue.base) starButton = IconButton(image: Icon.cm.star, tintColor: Color.white)
starButton.pulseColor = Color.white
} }
private func prepareSearchButton() { private func prepareSearchButton() {
searchButton = IconButton(image: Icon.cm.search, tintColor: Color.blue.base) searchButton = IconButton(image: Icon.cm.search, tintColor: Color.white)
searchButton.pulseColor = Color.white
} }
private func prepareNavigationItem() { private func prepareNavigationItem() {
navigationItem.title = "Material" navigationItem.title = "Material"
navigationItem.titleLabel.textColor = Color.white
navigationItem.detail = "Build Beautiful Software" navigationItem.detail = "Build Beautiful Software"
navigationItem.detailLabel.textColor = Color.lightBlue.lighten5
navigationItem.leftViews = [menuButton] navigationItem.leftViews = [menuButton]
navigationItem.rightViews = [starButton, searchButton] navigationItem.rightViews = [starButton, searchButton]
......
...@@ -34,6 +34,6 @@ import Material ...@@ -34,6 +34,6 @@ import Material
class RootViewController: UIViewController { class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.grey.lighten1 view.backgroundColor = Color.white
} }
} }
...@@ -41,7 +41,8 @@ class AppPageTabBarController: PageTabBarController { ...@@ -41,7 +41,8 @@ class AppPageTabBarController: PageTabBarController {
/// Prepares the pageTabBar. /// Prepares the pageTabBar.
private func preparePageTabBar() { private func preparePageTabBar() {
pageTabBar.lineColor = Color.grey.darken1 pageTabBar.lineColor = Color.blue.base
pageTabBar.dividerColor = Color.blueGrey.lighten5
} }
} }
......
...@@ -44,7 +44,7 @@ class BlueViewController: UIViewController { ...@@ -44,7 +44,7 @@ class BlueViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.blue.base view.backgroundColor = Color.white
} }
/// Prepares the pageTabBarItem. /// Prepares the pageTabBarItem.
......
...@@ -44,7 +44,7 @@ class GreenViewController: UIViewController { ...@@ -44,7 +44,7 @@ class GreenViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.green.base view.backgroundColor = Color.white
} }
/// Prepares the pageTabBarItem. /// Prepares the pageTabBarItem.
......
...@@ -44,7 +44,7 @@ class RedViewController: UIViewController { ...@@ -44,7 +44,7 @@ class RedViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.red.base view.backgroundColor = Color.white
} }
/// Prepares the pageTabBarItem. /// Prepares the pageTabBarItem.
......
...@@ -34,7 +34,7 @@ import Material ...@@ -34,7 +34,7 @@ import Material
class PhotoLibraryCollectionViewCell: CollectionViewCell { class PhotoLibraryCollectionViewCell: CollectionViewCell {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
pulse.animation = .backing pulseAnimation = .backing
contentsGravityPreset = .ResizeAspectFill contentsGravityPreset = .ResizeAspectFill
} }
} }
...@@ -53,7 +53,7 @@ class RemindersItemsCollectionViewCell: CollectionViewCell { ...@@ -53,7 +53,7 @@ class RemindersItemsCollectionViewCell: CollectionViewCell {
/// Prepares the divider. /// Prepares the divider.
private func prepareDivider() { private func prepareDivider() {
divider.color = Color.grey.lighten3 dividerColor = Color.grey.lighten3
} }
} }
...@@ -52,7 +52,7 @@ class RemindersItemsViewController: UIViewController { ...@@ -52,7 +52,7 @@ class RemindersItemsViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.grey.lighten5 view.backgroundColor = Color.white
prepareDateFormatter() prepareDateFormatter()
prepareNavigationItem() prepareNavigationItem()
...@@ -106,14 +106,14 @@ extension RemindersItemsViewController: UICollectionViewDataSource { ...@@ -106,14 +106,14 @@ extension RemindersItemsViewController: UICollectionViewDataSource {
/// Returns the number of sections. /// Returns the number of sections.
func numberOfSections(in collectionView: UICollectionView) -> Int { func numberOfSections(in collectionView: UICollectionView) -> Int {
return dataSource.items.count return 1 // dataSource.items.count
} }
/// Prepares the cells within the collectionView. /// Prepares the cells within the collectionView.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RemindersItemsCollectionViewCell", for: indexPath) as! RemindersItemsCollectionViewCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RemindersItemsCollectionViewCell", for: indexPath) as! RemindersItemsCollectionViewCell
let item = dataSource.items[indexPath.section] let item = dataSource.items.last!
cell.textLabel.text = item.title cell.textLabel.text = item.title
return cell return cell
......
...@@ -61,6 +61,6 @@ class RemindersListCollectionViewCell: CollectionViewCell { ...@@ -61,6 +61,6 @@ class RemindersListCollectionViewCell: CollectionViewCell {
/// Prepares the divider. /// Prepares the divider.
private func prepareDivider() { private func prepareDivider() {
divider.color = Color.grey.lighten3 dividerColor = Color.grey.lighten3
} }
} }
...@@ -49,7 +49,7 @@ class RemindersListViewController: RemindersController { ...@@ -49,7 +49,7 @@ class RemindersListViewController: RemindersController {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
view.backgroundColor = Color.grey.lighten5 view.backgroundColor = Color.white
prepareNavigationItem() prepareNavigationItem()
prepareCollectionView() prepareCollectionView()
...@@ -176,7 +176,7 @@ extension RemindersListViewController: UICollectionViewDataSource { ...@@ -176,7 +176,7 @@ extension RemindersListViewController: UICollectionViewDataSource {
let items = dataSource.items let items = dataSource.items
cell.titleLabel.text = list.title cell.titleLabel.text = list.title
cell.titleLabel.textColor = UIColor(cgColor: list.cgColor) cell.titleLabel.textColor = UIColor(cgColor: list.cgColor)
cell.countLabel.text = "\(items.count)" cell.countLabel.text = "1"
cell.countLabel.textColor = UIColor(cgColor: list.cgColor) cell.countLabel.textColor = UIColor(cgColor: list.cgColor)
return cell return cell
......
...@@ -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 = Color.grey.lighten1 view.backgroundColor = Color.white
prepareUndoButton() prepareUndoButton()
} }
......
...@@ -262,6 +262,7 @@ ...@@ -262,6 +262,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Switch/Info.plist; INFOPLIST_FILE = Switch/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Switch; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Switch;
...@@ -274,6 +275,7 @@ ...@@ -274,6 +275,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Switch/Info.plist; INFOPLIST_FILE = Switch/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Switch; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Switch;
......
...@@ -262,6 +262,7 @@ ...@@ -262,6 +262,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TabBar/Info.plist; INFOPLIST_FILE = TabBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
...@@ -274,6 +275,7 @@ ...@@ -274,6 +275,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = TabBar/Info.plist; INFOPLIST_FILE = TabBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
......
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = ToolbarController/Info.plist; INFOPLIST_FILE = ToolbarController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController;
...@@ -278,6 +279,7 @@ ...@@ -278,6 +279,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = ToolbarController/Info.plist; INFOPLIST_FILE = ToolbarController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.ToolbarController;
......
...@@ -39,7 +39,7 @@ class RootViewController: UIViewController { ...@@ -39,7 +39,7 @@ class RootViewController: UIViewController {
open override func viewDidLoad() { open override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
view.backgroundColor = Color.grey.lighten1 view.backgroundColor = Color.white
} }
open override func viewWillAppear(_ animated: Bool) { open override func viewWillAppear(_ animated: Bool) {
...@@ -69,7 +69,10 @@ class RootViewController: UIViewController { ...@@ -69,7 +69,10 @@ class RootViewController: UIViewController {
} }
tc.toolbar.title = "Marterial" tc.toolbar.title = "Marterial"
tc.toolbar.titleLabel.textAlignment = .left
tc.toolbar.detail = "Build Beautiful Software" tc.toolbar.detail = "Build Beautiful Software"
tc.toolbar.detailLabel.textAlignment = .left
tc.toolbar.leftViews = [menuButton] tc.toolbar.leftViews = [menuButton]
tc.toolbar.rightViews = [starButton, searchButton] tc.toolbar.rightViews = [starButton, searchButton]
......
...@@ -288,7 +288,7 @@ open class CollectionReusableView: UICollectionReusableView { ...@@ -288,7 +288,7 @@ open class CollectionReusableView: UICollectionReusableView {
*/ */
open func prepare() { open func prepare() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
pulse.animation = .none pulseAnimation = .none
prepareVisualLayer() prepareVisualLayer()
} }
......
...@@ -324,6 +324,8 @@ open class NavigationBar: UINavigationBar { ...@@ -324,6 +324,8 @@ open class NavigationBar: UINavigationBar {
when subclassing. when subclassing.
*/ */
public func prepare() { public func prepare() {
prepareDivider()
barStyle = .black barStyle = .black
isTranslucent = false isTranslucent = false
depthPreset = .depth1 depthPreset = .depth1
...@@ -335,7 +337,6 @@ open class NavigationBar: UINavigationBar { ...@@ -335,7 +337,6 @@ open class NavigationBar: UINavigationBar {
shadowImage = image shadowImage = image
setBackgroundImage(image, for: .default) setBackgroundImage(image, for: .default)
backgroundColor = Color.white backgroundColor = Color.white
prepareDivider()
} }
/** /**
......
...@@ -447,7 +447,7 @@ open class TextField: UITextField { ...@@ -447,7 +447,7 @@ open class TextField: UITextField {
/// The animation for the divider when editing begins. /// The animation for the divider when editing begins.
open func dividerEditingDidBeginAnimation() { open func dividerEditingDidBeginAnimation() {
divider.height = dividerActiveHeight dividerHeight = dividerActiveHeight
divider.backgroundColor = nil == dividerActiveColor ? placeholderActiveColor.cgColor : dividerActiveColor!.cgColor divider.backgroundColor = nil == dividerActiveColor ? placeholderActiveColor.cgColor : dividerActiveColor!.cgColor
} }
......
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