Commit cebb68d0 by Daniel Dahan

fixed rotational statusBar issue with SideNavigationController

parent 75472447
......@@ -614,7 +614,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
public func closeLeftView(velocity: CGFloat = 0) {
if enabledLeftView {
if let v: MaterialView = leftView {
showStatusBar()
userInteractionEnabled = true
delegate?.sideNavigationWillClose?(self, position: .Left)
UIView.animateWithDuration(Double(0 == velocity ? animationDuration : fmax(0.1, fmin(1, Double(v.x / velocity)))),
......@@ -623,6 +622,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
self.rootViewController.view.alpha = 1
}) { [unowned self] _ in
self.hideView(v)
self.toggleStatusBar()
self.delegate?.sideNavigationDidClose?(self, position: .Left)
}
}
......@@ -647,6 +647,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
self.rootViewController.view.alpha = 1
}) { [unowned self] _ in
self.hideView(v)
self.toggleStatusBar()
self.delegate?.sideNavigationDidClose?(self, position: .Right)
}
}
......@@ -960,7 +961,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// Shows the statusBar.
private func showStatusBar() {
willHideStatusBar = false
if MaterialDevice.statusBarHidden {
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in
self?.setNeedsStatusBarAppearanceUpdate()
......@@ -968,12 +968,10 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
})
delegate?.sideNavigationStatusBarHiddenState?(self, hidden: false)
}
}
/// Hides the statusBar.
private func hideStatusBar() {
if enableHideStatusbar {
if !MaterialDevice.statusBarHidden {
willHideStatusBar = true
UIView.animateWithDuration(NSTimeInterval(UINavigationControllerHideShowBarDuration),
animations: { [weak self] in
......@@ -983,7 +981,6 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
delegate?.sideNavigationStatusBarHiddenState?(self, hidden: true)
}
}
}
/// Toggles the statusBar
private func toggleStatusBar() {
......
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