Commit 41ca8398 by Daniel Dahan

updated projects for the adjustments made to BarViews

parent 5586d0ae
...@@ -45,7 +45,7 @@ class AppSearchBarController: SearchBarController { ...@@ -45,7 +45,7 @@ class AppSearchBarController: SearchBarController {
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
searchBar.statusBarStyle = .Default statusBarStyle = .Default
sideNavigationController?.enabled = false sideNavigationController?.enabled = false
} }
......
...@@ -235,7 +235,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -235,7 +235,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
private func prepareToolbar() { private func prepareToolbar() {
toolbar.backgroundColor = nil toolbar.backgroundColor = nil
toolbar.depth = .None toolbar.depth = .None
toolbar.statusBarStyle = .LightContent
// Title label. // Title label.
let titleLabel: UILabel = UILabel() let titleLabel: UILabel = UILabel()
......
...@@ -40,6 +40,7 @@ class AppSearchBarController: SearchBarController { ...@@ -40,6 +40,7 @@ class AppSearchBarController: SearchBarController {
/// Prepares the view. /// Prepares the view.
override func prepareView() { override func prepareView() {
super.prepareView() super.prepareView()
statusBarStyle = .Default
prepareSearchBar() prepareSearchBar()
} }
...@@ -65,7 +66,6 @@ class AppSearchBarController: SearchBarController { ...@@ -65,7 +66,6 @@ class AppSearchBarController: SearchBarController {
"View controller-based status bar appearance = NO" "View controller-based status bar appearance = NO"
to your info.plist file and set the following property. to your info.plist file and set the following property.
*/ */
searchBar.statusBarStyle = .Default
searchBar.textField.delegate = self searchBar.textField.delegate = self
searchBar.leftControls = [backButton] searchBar.leftControls = [backButton]
searchBar.rightControls = [moreButton] searchBar.rightControls = [moreButton]
......
...@@ -40,6 +40,7 @@ class AppToolbarController: ToolbarController { ...@@ -40,6 +40,7 @@ class AppToolbarController: ToolbarController {
/// Prepares the view. /// Prepares the view.
override func prepareView() { override func prepareView() {
super.prepareView() super.prepareView()
statusBarStyle = .LightContent
prepareToolbar() prepareToolbar()
} }
...@@ -86,7 +87,6 @@ class AppToolbarController: ToolbarController { ...@@ -86,7 +87,6 @@ class AppToolbarController: ToolbarController {
searchButton.setImage(image, forState: .Highlighted) searchButton.setImage(image, forState: .Highlighted)
searchButton.addTarget(self, action: #selector(handleSearchButton), forControlEvents: .TouchUpInside) searchButton.addTarget(self, action: #selector(handleSearchButton), forControlEvents: .TouchUpInside)
toolbar.statusBarStyle = .LightContent
toolbar.backgroundColor = MaterialColor.blue.base toolbar.backgroundColor = MaterialColor.blue.base
toolbar.leftControls = [menuButton] toolbar.leftControls = [menuButton]
toolbar.rightControls = [switchControl, searchButton] toolbar.rightControls = [switchControl, searchButton]
......
...@@ -49,13 +49,14 @@ class ViewController: UIViewController { ...@@ -49,13 +49,14 @@ class ViewController: UIViewController {
} }
/// Adjusts the Toolbar height to the correct height based on the orientation value. /// Adjusts the Toolbar height to the correct height based on the orientation value.
private func adjustToOrientation(toInterfaceOrientation: UIInterfaceOrientation) { private func adjustToOrientation(interfaceOrientation: UIInterfaceOrientation) {
toolbar.contentInset.top = .iPad == MaterialDevice.type || UIInterfaceOrientationIsPortrait(toInterfaceOrientation) ? 20 : 4 toolbar.grid.layoutInset.top = .iPad == MaterialDevice.type || UIInterfaceOrientationIsPortrait(interfaceOrientation) ? 20 : 0
toolbarHeightConstraint?.constant = toolbar.intrinsicContentSize().height toolbarHeightConstraint?.constant = toolbar.intrinsicContentSize().height + toolbar.grid.layoutInset.top
} }
/// General preparation statements. /// General preparation statements.
private func prepareView() { private func prepareView() {
MaterialDevice.statusBarStyle = .LightContent
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.white
} }
...@@ -64,10 +65,6 @@ class ViewController: UIViewController { ...@@ -64,10 +65,6 @@ class ViewController: UIViewController {
// Stylize. // Stylize.
toolbar.backgroundColor = MaterialColor.indigo.darken1 toolbar.backgroundColor = MaterialColor.indigo.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
toolbar.statusBarStyle = .LightContent
// Title label. // Title label.
toolbar.title = "Material" toolbar.title = "Material"
toolbar.titleLabel.textColor = MaterialColor.white toolbar.titleLabel.textColor = MaterialColor.white
......
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