Commit 7c7c0462 by Daniel Dahan

updated NavigationDrawerController with minor edits, in perparation for hiding/showing status bar

parent 5de32900
...@@ -37,9 +37,13 @@ class AppNavigationController: NavigationController { ...@@ -37,9 +37,13 @@ class AppNavigationController: NavigationController {
prepareNavigationBar() prepareNavigationBar()
} }
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationBar.statusBarStyle = .LightContent
}
/// Prepares the navigationBar /// Prepares the navigationBar
private func prepareNavigationBar() { private func prepareNavigationBar() {
navigationBar.statusBarStyle = .LightContent
navigationBar.tintColor = MaterialColor.white navigationBar.tintColor = MaterialColor.white
navigationBar.backgroundColor = MaterialColor.blue.base navigationBar.backgroundColor = MaterialColor.blue.base
} }
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
......
...@@ -425,7 +425,6 @@ public class NavigationBar : UINavigationBar { ...@@ -425,7 +425,6 @@ public class NavigationBar : UINavigationBar {
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepareView() {
barStyle = .Black
translucent = false translucent = false
depth = .Depth1 depth = .Depth1
spacingPreset = .Spacing1 spacingPreset = .Spacing1
......
...@@ -1083,11 +1083,13 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD ...@@ -1083,11 +1083,13 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Shows the statusBar. /// Shows the statusBar.
private func showStatusBar() { private func showStatusBar() {
if statusBarHidden { if statusBarHidden {
willHideStatusBar = false
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration), UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in animations: { [weak self] in
self?.statusBarHidden = false if let s: NavigationDrawerController = self {
self?.setNeedsStatusBarAppearanceUpdate() s.statusBarHidden = false
s.willHideStatusBar = false
s.setNeedsStatusBarAppearanceUpdate()
}
}) })
delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: false) delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: false)
} }
...@@ -1096,12 +1098,14 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD ...@@ -1096,12 +1098,14 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Hides the statusBar. /// Hides the statusBar.
private func hideStatusBar() { private func hideStatusBar() {
if enableHideStatusbar { if enableHideStatusbar {
willHideStatusBar = true
if !statusBarHidden { if !statusBarHidden {
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration), UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in animations: { [weak self] in
self?.statusBarHidden = true if let s: NavigationDrawerController = self {
self?.setNeedsStatusBarAppearanceUpdate() s.statusBarHidden = true
s.willHideStatusBar = true
s.setNeedsStatusBarAppearanceUpdate()
}
}) })
delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: true) delegate?.navigationDrawerStatusBarHiddenState?(self, hidden: true)
} }
...@@ -1177,6 +1181,8 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD ...@@ -1177,6 +1181,8 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Layout subviews. /// Layout subviews.
private func layoutSubviews() { private func layoutSubviews() {
rootViewController.view.frame = view.bounds
if let v: MaterialView = leftView { if let v: MaterialView = leftView {
v.width = leftViewWidth v.width = leftViewWidth
v.height = view.bounds.height v.height = view.bounds.height
......
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