Commit e04352d4 by Daniel Dahan

updated App project and default MaterialSwitch colors

parent 36ce2bb1
......@@ -33,7 +33,7 @@ import Material
class AppNavigationController: NavigationController {
/// StatusBar color reference.
private var statusBarView: MaterialView!
private var statusBarView: MaterialView?
override func viewDidLoad() {
super.viewDidLoad()
......@@ -43,19 +43,19 @@ class AppNavigationController: NavigationController {
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
statusBarView.hidden = MaterialDevice.statusBarHidden
statusBarView?.hidden = MaterialDevice.statusBarHidden
}
/// Prepares the statusBarView
private func prepareStatusBarView() {
statusBarView = MaterialView()
statusBarView.backgroundColor = MaterialColor.blue.darken2
statusBarView!.backgroundColor = MaterialColor.blue.darken2
view.addSubview(statusBarView)
statusBarView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: statusBarView)
MaterialLayout.alignToParentHorizontally(view, child: statusBarView)
MaterialLayout.height(view, child: statusBarView, height: 20)
view.addSubview(statusBarView!)
statusBarView!.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: statusBarView!)
MaterialLayout.alignToParentHorizontally(view, child: statusBarView!)
MaterialLayout.height(view, child: statusBarView!, height: 20)
}
......
<?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>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
......@@ -15,7 +16,6 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
......
......@@ -52,6 +52,7 @@ class RecipesViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareItems()
prepareTitleLabel()
prepareMenuButton()
......
......@@ -53,6 +53,7 @@ class RecommendationViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareTableView()
}
......
......@@ -11,8 +11,6 @@
969792471CAB6AF5002F2880 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 969792461CAB6AF5002F2880 /* ViewController.swift */; };
9697924C1CAB6AF5002F2880 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9697924B1CAB6AF5002F2880 /* Assets.xcassets */; };
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 */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -22,7 +20,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
969792581CAB6C14002F2880 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -36,7 +33,6 @@
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>"; };
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 */
/* Begin PBXFrameworksBuildPhase section */
......@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
969792571CAB6C14002F2880 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -54,7 +49,6 @@
969792381CAB6AF5002F2880 = {
isa = PBXGroup;
children = (
969792561CAB6C14002F2880 /* Material.framework */,
969792431CAB6AF5002F2880 /* MaterialCollectionView */,
969792421CAB6AF5002F2880 /* Products */,
);
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.38.2'
s.version = '1.38.3'
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.homepage = 'http://cosmicmind.io'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.38.2</string>
<string>1.38.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -227,8 +227,8 @@ public class MaterialSwitch : UIControl {
didSet {
switch switchStyle {
case .LightContent:
buttonOnColor = MaterialColor.lightBlue.darken3
trackOnColor = MaterialColor.lightBlue.lighten3
buttonOnColor = MaterialColor.blue.darken2
trackOnColor = MaterialColor.blue.lighten3
buttonOffColor = MaterialColor.blueGrey.lighten4
trackOffColor = MaterialColor.blueGrey.lighten3
buttonOnDisabledColor = MaterialColor.grey.lighten2
......@@ -236,8 +236,8 @@ public class MaterialSwitch : UIControl {
buttonOffDisabledColor = MaterialColor.grey.lighten2
trackOffDisabledColor = MaterialColor.grey.lighten3
case .Default:
buttonOnColor = MaterialColor.lightBlue.lighten1
trackOnColor = MaterialColor.lightBlue.lighten2.colorWithAlphaComponent(0.5)
buttonOnColor = MaterialColor.blue.lighten1
trackOnColor = MaterialColor.blue.lighten2.colorWithAlphaComponent(0.5)
buttonOffColor = MaterialColor.blueGrey.lighten3
trackOffColor = MaterialColor.blueGrey.lighten4.colorWithAlphaComponent(0.5)
buttonOnDisabledColor = MaterialColor.grey.darken3
......
......@@ -83,8 +83,10 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
public override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
// Load the initial topItem.
if let v: UINavigationItem = navigationBar.topItem {
(navigationBar as? NavigationBar)?.layoutNavigationItem(v)
if let v: NavigationBar = navigationBar as? NavigationBar {
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