Commit 8c5de0bc by Daniel Dahan

updated NavigationBarView default text sizing to handle lowercase long letters.

parent 96df5177
...@@ -5,12 +5,19 @@ Please read it before you start participating. ...@@ -5,12 +5,19 @@ Please read it before you start participating.
**Topics** **Topics**
* [Pull Request Submissions](#pull-request-submissions)
* [Asking Questions](#asking-questions) * [Asking Questions](#asking-questions)
* [Reporting Security Issues](#reporting-security-issues) * [Reporting Security Issues](#reporting-security-issues)
* [Reporting Issues](#reporting-other-issues) * [Reporting Issues](#reporting-other-issues)
* [Developers Certificate of Origin](#developers-certificate-of-origin) * [Developers Certificate of Origin](#developers-certificate-of-origin)
* [Code of Conduct](#code-of-conduct) * [Code of Conduct](#code-of-conduct)
<a href="#pull-request-submissions"></a>
## Pull Request Submissions.
All pull requests should be made to the development branch. Details should be available describing your fix. Before submitting a pull request, please confirm that merge issues are resolved.
<a href="#asking-questions"></a>
## Asking Questions ## Asking Questions
We don't use GitHub as a support forum. We don't use GitHub as a support forum.
...@@ -20,6 +27,7 @@ By doing so, you'll be more likely to quickly solve your problem, ...@@ -20,6 +27,7 @@ By doing so, you'll be more likely to quickly solve your problem,
and you'll allow anyone else with the same question to find the answer. and you'll allow anyone else with the same question to find the answer.
This also allows maintainers to focus on improving the project for others. This also allows maintainers to focus on improving the project for others.
<a href="#reporting-security-issues"></a>
## Reporting Security Issues ## Reporting Security Issues
CosmicMind takes security seriously. CosmicMind takes security seriously.
...@@ -31,6 +39,7 @@ This will help ensure that any vulnerabilities that _are_ found ...@@ -31,6 +39,7 @@ This will help ensure that any vulnerabilities that _are_ found
can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure) can be [disclosed responsibly](http://en.wikipedia.org/wiki/Responsible_disclosure)
to any affected parties. to any affected parties.
<a href="#reporting-other-issues"></a>
## Reporting Other Issues ## Reporting Other Issues
A great way to contribute to the project A great way to contribute to the project
...@@ -52,6 +61,7 @@ When reporting issues, please include the following: ...@@ -52,6 +61,7 @@ When reporting issues, please include the following:
This information will help us review and fix your issue faster. This information will help us review and fix your issue faster.
<a href="#developers-certificate-of-origin"></a>
## Developer's Certificate of Origin 1.1 ## Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that: By making a contribution to this project, I certify that:
......
...@@ -51,12 +51,14 @@ class AppMenuViewController: MenuViewController { ...@@ -51,12 +51,14 @@ class AppMenuViewController: MenuViewController {
override func openMenu(completion: (() -> Void)? = nil) { override func openMenu(completion: (() -> Void)? = nil) {
super.openMenu(completion) super.openMenu(completion)
sideNavigationViewController?.enabled = false
mainViewController.view.alpha = 0.5 mainViewController.view.alpha = 0.5
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(0.125)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(0.125))
} }
override func closeMenu(completion: (() -> Void)? = nil) { override func closeMenu(completion: (() -> Void)? = nil) {
super.closeMenu(completion) super.closeMenu(completion)
sideNavigationViewController?.enabled = true
mainViewController.view.alpha = 1 mainViewController.view.alpha = 1
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(-0.125)) (menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(-0.125))
} }
......
...@@ -58,7 +58,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -58,7 +58,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
/// Prepares view. /// Prepares view.
private func prepareView() { private func prepareView() {
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.black
} }
/// Toggle SideNavigationViewController left UIViewController. /// Toggle SideNavigationViewController left UIViewController.
...@@ -68,11 +68,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -68,11 +68,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
/// Toggle SideNavigationViewController right UIViewController. /// Toggle SideNavigationViewController right UIViewController.
internal func handleSearchButton() { internal func handleSearchButton() {
guard let v: AppSearchBarViewController = AppSearchBarViewController(mainViewController: SearchListViewController()) else { floatingViewController = AppSearchBarViewController(mainViewController: SearchListViewController())
return
}
floatingViewController = v
} }
/// Prepares the navigationBarView. /// Prepares the navigationBarView.
...@@ -82,7 +78,7 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -82,7 +78,7 @@ class AppNavigationBarViewController: NavigationBarViewController {
titleLabel.text = "Feed" titleLabel.text = "Feed"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(20) titleLabel.font = RobotoFont.regular
var image = UIImage(named: "ic_menu_white") var image = UIImage(named: "ic_menu_white")
......
...@@ -43,9 +43,16 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -43,9 +43,16 @@ class AppSearchBarViewController: SearchBarViewController {
prepareSearchBarView() prepareSearchBarView()
} }
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
sideNavigationViewController?.enabled = true
}
override func viewWillAppear(animated: Bool) { override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
searchBarView.statusBarStyle = .Default
sideNavigationViewController?.delegate = self sideNavigationViewController?.delegate = self
sideNavigationViewController?.enabled = false
} }
/// Toggle SideSearchViewController left UIViewController. /// Toggle SideSearchViewController left UIViewController.
...@@ -97,8 +104,6 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -97,8 +104,6 @@ class AppSearchBarViewController: SearchBarViewController {
moreButton.setImage(image, forState: .Highlighted) moreButton.setImage(image, forState: .Highlighted)
moreButton.addTarget(self, action: "handleMoreButton", forControlEvents: .TouchUpInside) moreButton.addTarget(self, action: "handleMoreButton", forControlEvents: .TouchUpInside)
searchBarView.statusBarStyle = .Default
searchBarView.delegate = self searchBarView.delegate = self
searchBarView.placeholder = "Search" searchBarView.placeholder = "Search"
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBarView.tintColor = MaterialColor.blueGrey.darken4
...@@ -126,5 +131,6 @@ extension AppSearchBarViewController: TextFieldDelegate { ...@@ -126,5 +131,6 @@ extension AppSearchBarViewController: TextFieldDelegate {
extension AppSearchBarViewController: SideNavigationViewControllerDelegate { extension AppSearchBarViewController: SideNavigationViewControllerDelegate {
func sideNavigationViewDidClose(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) { func sideNavigationViewDidClose(sideNavigationViewController: SideNavigationViewController, position: SideNavigationPosition) {
searchBarView.textField.becomeFirstResponder() searchBarView.textField.becomeFirstResponder()
sideNavigationViewController.enabled = false
} }
} }
...@@ -34,8 +34,7 @@ import AVFoundation ...@@ -34,8 +34,7 @@ import AVFoundation
class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDelegate { class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDelegate {
lazy var captureView: CaptureView = CaptureView() lazy var captureView: CaptureView = CaptureView()
lazy var navigationBarView: NavigationBarView = NavigationBarView(frame: CGRectNull) lazy var navigationBarView: NavigationBarView = NavigationBarView()
lazy var closeButton: FlatButton = FlatButton()
lazy var cameraButton: FlatButton = FlatButton() lazy var cameraButton: FlatButton = FlatButton()
lazy var videoButton: FlatButton = FlatButton() lazy var videoButton: FlatButton = FlatButton()
lazy var switchCamerasButton: FlatButton = FlatButton() lazy var switchCamerasButton: FlatButton = FlatButton()
...@@ -48,7 +47,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -48,7 +47,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
prepareCaptureButton() prepareCaptureButton()
prepareCameraButton() prepareCameraButton()
prepareVideoButton() prepareVideoButton()
prepareCloseButton()
prepareSwitchCamerasButton() prepareSwitchCamerasButton()
prepareFlashButton() prepareFlashButton()
prepareCaptureView() prepareCaptureView()
...@@ -82,7 +80,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -82,7 +80,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
func captureDidStartRecordingToOutputFileAtURL(capture: CaptureSession, captureOutput: AVCaptureFileOutput, fileURL: NSURL, fromConnections connections: [AnyObject]) { func captureDidStartRecordingToOutputFileAtURL(capture: CaptureSession, captureOutput: AVCaptureFileOutput, fileURL: NSURL, fromConnections connections: [AnyObject]) {
print("Capture Started Recording \(fileURL)") print("Capture Started Recording \(fileURL)")
closeButton.hidden = true
cameraButton.hidden = true cameraButton.hidden = true
videoButton.hidden = true videoButton.hidden = true
switchCamerasButton.hidden = true switchCamerasButton.hidden = true
...@@ -95,7 +92,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -95,7 +92,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
func captureDidFinishRecordingToOutputFileAtURL(capture: CaptureSession, captureOutput: AVCaptureFileOutput, outputFileURL: NSURL, fromConnections connections: [AnyObject], error: NSError!) { func captureDidFinishRecordingToOutputFileAtURL(capture: CaptureSession, captureOutput: AVCaptureFileOutput, outputFileURL: NSURL, fromConnections connections: [AnyObject], error: NSError!) {
print("Capture Stopped Recording \(outputFileURL)") print("Capture Stopped Recording \(outputFileURL)")
closeButton.hidden = false
cameraButton.hidden = false cameraButton.hidden = false
videoButton.hidden = false videoButton.hidden = false
switchCamerasButton.hidden = false switchCamerasButton.hidden = false
...@@ -247,7 +243,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -247,7 +243,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
titleLabel.hidden = true titleLabel.hidden = true
titleLabel.textAlignment = .Center titleLabel.textAlignment = .Center
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(20) titleLabel.font = RobotoFont.regular
navigationBarView.titleLabel = titleLabel navigationBarView.titleLabel = titleLabel
// Detail label. // Detail label.
...@@ -256,17 +252,13 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -256,17 +252,13 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
detailLabel.text = "Recording" detailLabel.text = "Recording"
detailLabel.textAlignment = .Center detailLabel.textAlignment = .Center
detailLabel.textColor = MaterialColor.red.accent1 detailLabel.textColor = MaterialColor.red.accent1
detailLabel.font = RobotoFont.regularWithSize(12) detailLabel.font = RobotoFont.regular
navigationBarView.detailLabel = detailLabel navigationBarView.detailLabel = detailLabel
navigationBarView.leftButtons = [closeButton] navigationBarView.leftControls = [switchCamerasButton]
navigationBarView.rightButtons = [switchCamerasButton, flashButton] navigationBarView.rightControls = [flashButton]
view.addSubview(navigationBarView) view.addSubview(navigationBarView)
navigationBarView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: navigationBarView)
MaterialLayout.alignToParentHorizontally(view, child: navigationBarView)
MaterialLayout.height(view, child: navigationBarView, height: 70)
} }
/** /**
...@@ -313,16 +305,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg ...@@ -313,16 +305,6 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
} }
/** /**
:name: prepareCloseButton
*/
private func prepareCloseButton() {
let img: UIImage? = UIImage(named: "ic_close_white")
closeButton.pulseColor = nil
closeButton.setImage(img, forState: .Normal)
closeButton.setImage(img, forState: .Highlighted)
}
/**
:name: prepareSwitchCamerasButton :name: prepareSwitchCamerasButton
*/ */
private func prepareSwitchCamerasButton() { private func prepareSwitchCamerasButton() {
......
...@@ -59,14 +59,14 @@ class ViewController: UIViewController { ...@@ -59,14 +59,14 @@ class ViewController: UIViewController {
titleLabel.text = "Material" titleLabel.text = "Material"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(17) titleLabel.font = RobotoFont.regular
// Detail label. // Detail label.
let detailLabel: UILabel = UILabel() let detailLabel: UILabel = UILabel()
detailLabel.text = "Build Beautiful Software" detailLabel.text = "Build Beautiful Software"
detailLabel.textAlignment = .Left detailLabel.textAlignment = .Left
detailLabel.textColor = MaterialColor.white detailLabel.textColor = MaterialColor.white
detailLabel.font = RobotoFont.regularWithSize(12) detailLabel.font = RobotoFont.regular
var image = UIImage(named: "ic_menu_white") var image = UIImage(named: "ic_menu_white")
......
...@@ -82,15 +82,14 @@ class AppNavigationBarViewController: NavigationBarViewController { ...@@ -82,15 +82,14 @@ class AppNavigationBarViewController: NavigationBarViewController {
titleLabel.text = "Material" titleLabel.text = "Material"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(20) titleLabel.font = RobotoFont.regular
// 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()
// detailLabel.text = "Build Beautiful Software" // detailLabel.text = "Build Beautiful Software"
// detailLabel.textAlignment = .Left // detailLabel.textAlignment = .Left
// detailLabel.textColor = MaterialColor.white // detailLabel.textColor = MaterialColor.white
// detailLabel.font = RobotoFont.regularWithSize(12) // detailLabel.font = RobotoFont.regular
// 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")
......
...@@ -96,7 +96,7 @@ class ViewController: UIViewController { ...@@ -96,7 +96,7 @@ class ViewController: UIViewController {
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(17) searchBarView.textField.font = RobotoFont.regularWithSize(20)
searchBarView.clearButton = clearButton searchBarView.clearButton = clearButton
searchBarView.leftControls = [backButton] searchBarView.leftControls = [backButton]
......
...@@ -126,7 +126,7 @@ class AppSearchBarViewController: SearchBarViewController { ...@@ -126,7 +126,7 @@ class AppSearchBarViewController: SearchBarViewController {
searchBarView.tintColor = MaterialColor.blueGrey.darken4 searchBarView.tintColor = MaterialColor.blueGrey.darken4
searchBarView.textColor = MaterialColor.blueGrey.darken4 searchBarView.textColor = MaterialColor.blueGrey.darken4
searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4 searchBarView.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBarView.textField.font = RobotoFont.regularWithSize(17) searchBarView.textField.font = RobotoFont.regularWithSize(20)
searchBarView.textField.delegate = self searchBarView.textField.delegate = self
searchBarView.clearButton = clearButton searchBarView.clearButton = clearButton
......
...@@ -72,7 +72,7 @@ class ViewController: UIViewController { ...@@ -72,7 +72,7 @@ class ViewController: UIViewController {
titleLabel.text = "Material" titleLabel.text = "Material"
titleLabel.textAlignment = .Left titleLabel.textAlignment = .Left
titleLabel.textColor = MaterialColor.white titleLabel.textColor = MaterialColor.white
titleLabel.font = RobotoFont.regularWithSize(17) titleLabel.font = RobotoFont.regular
navigationBarView.titleLabel = titleLabel navigationBarView.titleLabel = titleLabel
// Detail label. // Detail label.
...@@ -80,7 +80,7 @@ class ViewController: UIViewController { ...@@ -80,7 +80,7 @@ class ViewController: UIViewController {
detailLabel.text = "Build Beautiful Software" detailLabel.text = "Build Beautiful Software"
detailLabel.textAlignment = .Left detailLabel.textAlignment = .Left
detailLabel.textColor = MaterialColor.white detailLabel.textColor = MaterialColor.white
detailLabel.font = RobotoFont.regularWithSize(12) detailLabel.font = RobotoFont.regular
navigationBarView.detailLabel = detailLabel navigationBarView.detailLabel = detailLabel
// Menu button. // Menu button.
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.34.0' s.version = '1.34.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'
......
...@@ -12,7 +12,7 @@ Express your creativity with Material, an animation and graphics framework for G ...@@ -12,7 +12,7 @@ Express your creativity with Material, an animation and graphics framework for G
- [x] Grid System For Complex UIs - [x] Grid System For Complex UIs
- [x] Layout Library To Simplify AutoLayout - [x] Layout Library To Simplify AutoLayout
- [x] Base Material Layers & Material Views To Create New UI Components - [x] Base Material Layers & Material Views To Create New UI Components
- [x] Navigation Controls - [x] Navigation Controllers
- [x] Material Buttons - [x] Material Buttons
- [x] Material Switch - [x] Material Switch
- [x] Material Card Views - [x] Material Card Views
......
...@@ -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.34.0</string> <string>1.34.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -73,36 +73,24 @@ public class NavigationBarView : StatusBarView { ...@@ -73,36 +73,24 @@ public class NavigationBarView : StatusBarView {
grid.axis.columns = Int(width / 48) grid.axis.columns = Int(width / 48)
// General alignment.
if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
// TitleView alignment. // TitleView alignment.
if let v: UILabel = titleLabel { if let v: UILabel = titleLabel {
if let d: UILabel = detailLabel { if let d: UILabel = detailLabel {
v.grid.rows = 7 v.grid.rows = 2
d.grid.rows = 5 v.font = v.font.fontWithSize(17)
contentView.grid.spacing = 4 d.grid.rows = 2
contentView.grid.contentInset.top = -3 d.font = d.font.fontWithSize(12)
contentView.grid.axis.rows = 3
contentView.grid.spacing = -8
contentView.grid.contentInset.top = -8
} else { } else {
v.grid.rows = 12 v.grid.rows = 1
v.font = v.font.fontWithSize(20)
contentView.grid.axis.rows = 1
contentView.grid.spacing = 0 contentView.grid.spacing = 0
contentView.grid.contentInset.top = 0 contentView.grid.contentInset.top = 0
} }
} }
} else {
// TitleView alignment.
if let v: UILabel = titleLabel {
if let d: UILabel = detailLabel {
v.grid.rows = 7
d.grid.rows = 5
contentView.grid.spacing = 4
contentView.grid.contentInset.top = -3
} else {
v.grid.rows = 12
contentView.grid.spacing = 0
contentView.grid.contentInset.top = 0
}
}
}
reloadView() reloadView()
} }
...@@ -111,7 +99,6 @@ public class NavigationBarView : StatusBarView { ...@@ -111,7 +99,6 @@ public class NavigationBarView : StatusBarView {
public override func reloadView() { public override func reloadView() {
super.reloadView() super.reloadView()
contentView.grid.views = [] contentView.grid.views = []
contentView.grid.axis.rows = 6
if let v: UILabel = titleLabel { if let v: UILabel = titleLabel {
contentView.grid.views?.append(v) contentView.grid.views?.append(v)
} }
...@@ -130,6 +117,7 @@ public class NavigationBarView : StatusBarView { ...@@ -130,6 +117,7 @@ public class NavigationBarView : StatusBarView {
*/ */
public override func prepareView() { public override func prepareView() {
super.prepareView() super.prepareView()
contentView.grid.axis.inherited = false
contentView.grid.axis.direction = .Vertical contentView.grid.axis.direction = .Vertical
} }
......
...@@ -62,6 +62,7 @@ public class NavigationBarViewController: UIViewController { ...@@ -62,6 +62,7 @@ public class NavigationBarViewController: UIViewController {
} }
set(value) { set(value) {
if let v: UIViewController = internalFloatingViewController { if let v: UIViewController = internalFloatingViewController {
internalFloatingViewController = nil
UIView.animateWithDuration(0.5, UIView.animateWithDuration(0.5,
animations: { [unowned self] in animations: { [unowned self] in
v.view.center.y = 2 * self.view.bounds.height v.view.center.y = 2 * self.view.bounds.height
...@@ -71,7 +72,6 @@ public class NavigationBarViewController: UIViewController { ...@@ -71,7 +72,6 @@ public class NavigationBarViewController: UIViewController {
v.willMoveToParentViewController(nil) v.willMoveToParentViewController(nil)
v.view.removeFromSuperview() v.view.removeFromSuperview()
v.removeFromParentViewController() v.removeFromParentViewController()
self.internalFloatingViewController = nil
self.userInteractionEnabled = true self.userInteractionEnabled = true
self.navigationBarView.userInteractionEnabled = true self.navigationBarView.userInteractionEnabled = true
} }
...@@ -89,16 +89,15 @@ public class NavigationBarViewController: UIViewController { ...@@ -89,16 +89,15 @@ public class NavigationBarViewController: UIViewController {
// Animate the noteButton out and the noteViewController! in. // Animate the noteButton out and the noteViewController! in.
v.view.hidden = false v.view.hidden = false
internalFloatingViewController = v
userInteractionEnabled = false
navigationBarView.userInteractionEnabled = false
UIView.animateWithDuration(0.5, UIView.animateWithDuration(0.5,
animations: { [unowned self] in animations: { [unowned self] in
v.view.center.y = self.view.bounds.height / 2 v.view.center.y = self.view.bounds.height / 2
self.navigationBarView.alpha = 0.5 self.navigationBarView.alpha = 0.5
self.mainViewController.view.alpha = 0.5 self.mainViewController.view.alpha = 0.5
}) { [unowned self] _ in })
self.userInteractionEnabled = false
self.navigationBarView.userInteractionEnabled = false
self.internalFloatingViewController = v
}
} }
} }
} }
......
...@@ -90,15 +90,6 @@ public class SearchBarView : StatusBarView { ...@@ -90,15 +90,6 @@ public class SearchBarView : StatusBarView {
grid.axis.columns = Int(width / 48) grid.axis.columns = Int(width / 48)
// General alignment.
if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
grid.contentInset.top = 8
height = 44
} else {
grid.contentInset.top = 28
height = 64
}
reloadView() reloadView()
} }
...@@ -126,12 +117,6 @@ public class SearchBarView : StatusBarView { ...@@ -126,12 +117,6 @@ public class SearchBarView : StatusBarView {
*/ */
public override func prepareView() { public override func prepareView() {
super.prepareView() super.prepareView()
grid.spacing = 8
grid.axis.inherited = false
grid.contentInset.left = 8
grid.contentInset.bottom = 8
grid.contentInset.right = 8
depth = .Depth1
prepareTextField() prepareTextField()
} }
......
...@@ -59,13 +59,14 @@ public class StatusBarView : ControlView { ...@@ -59,13 +59,14 @@ public class StatusBarView : ControlView {
width = UIScreen.mainScreen().bounds.width width = UIScreen.mainScreen().bounds.width
reloadView()
if frame.origin.x != oldFrame!.origin.x || frame.origin.y != oldFrame!.origin.y || frame.width != oldFrame!.width || frame.height != oldFrame!.height { if frame.origin.x != oldFrame!.origin.x || frame.origin.y != oldFrame!.origin.y || frame.width != oldFrame!.width || frame.height != oldFrame!.height {
if nil != delegate { if nil != delegate {
statusBarViewDidChangeLayout() statusBarViewDidChangeLayout()
} }
oldFrame = frame oldFrame = frame
} }
reloadView()
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
......
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