Commit a0d1e2ba by Daniel Dahan

fixed status bar issue when rotating SideNavigationViewController

parent 7d4f90e2
...@@ -125,7 +125,7 @@ class AppViewController: NavigationViewController { ...@@ -125,7 +125,7 @@ class AppViewController: NavigationViewController {
titleLabel.text = "Inbox" titleLabel.text = "Inbox"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(17) titleLabel.font = RobotoFont.regularWithSize(20)
// Detail label. Uncomment the code below to use a detail label. // Detail label. Uncomment the code below to use a detail label.
// let detailLabel: UILabel = UILabel() // let detailLabel: UILabel = UILabel()
...@@ -133,6 +133,7 @@ class AppViewController: NavigationViewController { ...@@ -133,6 +133,7 @@ class AppViewController: NavigationViewController {
// detailLabel.textAlignment = .Left // detailLabel.textAlignment = .Left
// detailLabel.textColor = MaterialColor.white // detailLabel.textColor = MaterialColor.white
// detailLabel.font = RobotoFont.regularWithSize(12) // detailLabel.font = RobotoFont.regularWithSize(12)
// titleLabel.font = RobotoFont.regularWithSize(17) // 17 point looks better with the detailLabel.
// navigationBarView.detailLabel = detailLabel // navigationBarView.detailLabel = detailLabel
var image = UIImage(named: "ic_menu_white") var image = UIImage(named: "ic_menu_white")
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.33.0' s.version = '1.33.1'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.33.0</string> <string>1.33.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -151,8 +151,7 @@ public class NavigationBarView : MaterialView { ...@@ -151,8 +151,7 @@ public class NavigationBarView : MaterialView {
super.layoutSubviews() super.layoutSubviews()
// General alignment. // General alignment.
switch UIDevice.currentDevice().orientation { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
case .LandscapeLeft, .LandscapeRight:
grid.contentInset.top = 8 grid.contentInset.top = 8
// TitleView alignment. // TitleView alignment.
...@@ -169,7 +168,7 @@ public class NavigationBarView : MaterialView { ...@@ -169,7 +168,7 @@ public class NavigationBarView : MaterialView {
} }
} }
height = 44 height = 44
default: } else {
grid.contentInset.top = 28 grid.contentInset.top = 28
// TitleView alignment. // TitleView alignment.
...@@ -204,10 +203,9 @@ public class NavigationBarView : MaterialView { ...@@ -204,10 +203,9 @@ public class NavigationBarView : MaterialView {
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
switch UIDevice.currentDevice().orientation { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
case .LandscapeLeft, .LandscapeRight:
return CGSizeMake(UIScreen.mainScreen().bounds.width, 44) return CGSizeMake(UIScreen.mainScreen().bounds.width, 44)
default: } else {
return CGSizeMake(UIScreen.mainScreen().bounds.width, 64) return CGSizeMake(UIScreen.mainScreen().bounds.width, 64)
} }
} }
......
...@@ -173,11 +173,10 @@ public class SearchBarView : MaterialView { ...@@ -173,11 +173,10 @@ public class SearchBarView : MaterialView {
super.layoutSubviews() super.layoutSubviews()
// General alignment. // General alignment.
switch UIDevice.currentDevice().orientation { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
case .LandscapeLeft, .LandscapeRight:
grid.contentInset.top = 8 grid.contentInset.top = 8
height = 44 height = 44
default: } else {
grid.contentInset.top = 28 grid.contentInset.top = 28
height = 64 height = 64
} }
......
...@@ -872,10 +872,9 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -872,10 +872,9 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
private func toggleStatusBar(hide: Bool = false) { private func toggleStatusBar(hide: Bool = false) {
if hideStatusBar { if hideStatusBar {
// General alignment. // General alignment.
switch UIDevice.currentDevice().orientation { if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
case .LandscapeLeft, .LandscapeRight:
UIApplication.sharedApplication().statusBarHidden = true UIApplication.sharedApplication().statusBarHidden = true
default: } else {
UIApplication.sharedApplication().statusBarHidden = opened ? true : hide UIApplication.sharedApplication().statusBarHidden = opened ? true : hide
} }
} }
......
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