Commit e04352d4 by Daniel Dahan

updated App project and default MaterialSwitch colors

parent 36ce2bb1
...@@ -33,7 +33,7 @@ import Material ...@@ -33,7 +33,7 @@ import Material
class AppNavigationController: NavigationController { class AppNavigationController: NavigationController {
/// StatusBar color reference. /// StatusBar color reference.
private var statusBarView: MaterialView! private var statusBarView: MaterialView?
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -43,19 +43,19 @@ class AppNavigationController: NavigationController { ...@@ -43,19 +43,19 @@ class AppNavigationController: NavigationController {
override func viewWillLayoutSubviews() { override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews() super.viewWillLayoutSubviews()
statusBarView.hidden = MaterialDevice.statusBarHidden statusBarView?.hidden = MaterialDevice.statusBarHidden
} }
/// Prepares the statusBarView /// Prepares the statusBarView
private func prepareStatusBarView() { private func prepareStatusBarView() {
statusBarView = MaterialView() statusBarView = MaterialView()
statusBarView.backgroundColor = MaterialColor.blue.darken2 statusBarView!.backgroundColor = MaterialColor.blue.darken2
view.addSubview(statusBarView) view.addSubview(statusBarView!)
statusBarView.translatesAutoresizingMaskIntoConstraints = false statusBarView!.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: statusBarView) MaterialLayout.alignFromTop(view, child: statusBarView!)
MaterialLayout.alignToParentHorizontally(view, child: statusBarView) MaterialLayout.alignToParentHorizontally(view, child: statusBarView!)
MaterialLayout.height(view, child: statusBarView, height: 20) MaterialLayout.height(view, child: statusBarView!, height: 20)
} }
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
...@@ -15,7 +16,6 @@ ...@@ -15,7 +16,6 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view> </view>
</viewController> </viewController>
......
...@@ -52,6 +52,7 @@ class RecipesViewController: UIViewController { ...@@ -52,6 +52,7 @@ class RecipesViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView()
prepareItems() prepareItems()
prepareTitleLabel() prepareTitleLabel()
prepareMenuButton() prepareMenuButton()
......
...@@ -53,6 +53,7 @@ class RecommendationViewController: UIViewController { ...@@ -53,6 +53,7 @@ class RecommendationViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView()
prepareTableView() prepareTableView()
} }
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
969792471CAB6AF5002F2880 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 969792461CAB6AF5002F2880 /* ViewController.swift */; }; 969792471CAB6AF5002F2880 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 969792461CAB6AF5002F2880 /* ViewController.swift */; };
9697924C1CAB6AF5002F2880 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9697924B1CAB6AF5002F2880 /* Assets.xcassets */; }; 9697924C1CAB6AF5002F2880 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9697924B1CAB6AF5002F2880 /* Assets.xcassets */; };
9697924F1CAB6AF5002F2880 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9697924D1CAB6AF5002F2880 /* LaunchScreen.storyboard */; }; 9697924F1CAB6AF5002F2880 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9697924D1CAB6AF5002F2880 /* LaunchScreen.storyboard */; };
969792571CAB6C14002F2880 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 969792561CAB6C14002F2880 /* Material.framework */; };
969792581CAB6C14002F2880 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 969792561CAB6C14002F2880 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -22,7 +20,6 @@ ...@@ -22,7 +20,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
969792581CAB6C14002F2880 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -36,7 +33,6 @@ ...@@ -36,7 +33,6 @@
9697924B1CAB6AF5002F2880 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 9697924B1CAB6AF5002F2880 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9697924E1CAB6AF5002F2880 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 9697924E1CAB6AF5002F2880 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
969792501CAB6AF5002F2880 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 969792501CAB6AF5002F2880 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
969792561CAB6C14002F2880 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -44,7 +40,6 @@ ...@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
969792571CAB6C14002F2880 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -54,7 +49,6 @@ ...@@ -54,7 +49,6 @@
969792381CAB6AF5002F2880 = { 969792381CAB6AF5002F2880 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
969792561CAB6C14002F2880 /* Material.framework */,
969792431CAB6AF5002F2880 /* MaterialCollectionView */, 969792431CAB6AF5002F2880 /* MaterialCollectionView */,
969792421CAB6AF5002F2880 /* Products */, 969792421CAB6AF5002F2880 /* Products */,
); );
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.38.2' s.version = '1.38.3'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.38.2</string> <string>1.38.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -227,8 +227,8 @@ public class MaterialSwitch : UIControl { ...@@ -227,8 +227,8 @@ public class MaterialSwitch : UIControl {
didSet { didSet {
switch switchStyle { switch switchStyle {
case .LightContent: case .LightContent:
buttonOnColor = MaterialColor.lightBlue.darken3 buttonOnColor = MaterialColor.blue.darken2
trackOnColor = MaterialColor.lightBlue.lighten3 trackOnColor = MaterialColor.blue.lighten3
buttonOffColor = MaterialColor.blueGrey.lighten4 buttonOffColor = MaterialColor.blueGrey.lighten4
trackOffColor = MaterialColor.blueGrey.lighten3 trackOffColor = MaterialColor.blueGrey.lighten3
buttonOnDisabledColor = MaterialColor.grey.lighten2 buttonOnDisabledColor = MaterialColor.grey.lighten2
...@@ -236,8 +236,8 @@ public class MaterialSwitch : UIControl { ...@@ -236,8 +236,8 @@ public class MaterialSwitch : UIControl {
buttonOffDisabledColor = MaterialColor.grey.lighten2 buttonOffDisabledColor = MaterialColor.grey.lighten2
trackOffDisabledColor = MaterialColor.grey.lighten3 trackOffDisabledColor = MaterialColor.grey.lighten3
case .Default: case .Default:
buttonOnColor = MaterialColor.lightBlue.lighten1 buttonOnColor = MaterialColor.blue.lighten1
trackOnColor = MaterialColor.lightBlue.lighten2.colorWithAlphaComponent(0.5) trackOnColor = MaterialColor.blue.lighten2.colorWithAlphaComponent(0.5)
buttonOffColor = MaterialColor.blueGrey.lighten3 buttonOffColor = MaterialColor.blueGrey.lighten3
trackOffColor = MaterialColor.blueGrey.lighten4.colorWithAlphaComponent(0.5) trackOffColor = MaterialColor.blueGrey.lighten4.colorWithAlphaComponent(0.5)
buttonOnDisabledColor = MaterialColor.grey.darken3 buttonOnDisabledColor = MaterialColor.grey.darken3
......
...@@ -83,8 +83,10 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -83,8 +83,10 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
public override func viewDidAppear(animated: Bool) { public override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated) super.viewDidAppear(animated)
// Load the initial topItem. // Load the initial topItem.
if let v: UINavigationItem = navigationBar.topItem { if let v: NavigationBar = navigationBar as? NavigationBar {
(navigationBar as? NavigationBar)?.layoutNavigationItem(v) if let item: UINavigationItem = v.topItem {
v.layoutNavigationItem(item)
}
} }
} }
......
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