Commit 41ca8398 by Daniel Dahan

updated projects for the adjustments made to BarViews

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