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