Commit 543c6864 by Daniel Dahan

development: fixed issue-553 where NavigationDrawerController leftViewController…

development: fixed issue-553 where NavigationDrawerController leftViewController was not resizing correctly
parent 0cc2e969
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.3.18' s.version = '2.3.19'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.' s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -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>2.3.18</string> <string>2.3.19</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -312,18 +312,18 @@ open class NavigationDrawerController: RootController { ...@@ -312,18 +312,18 @@ open class NavigationDrawerController: RootController {
open var depthPreset = DepthPreset.depth1 open var depthPreset = DepthPreset.depth1
/** /**
A View property that is used to hide and reveal the A UIView property that is used to hide and reveal the
leftViewController. It is very rare that this property will leftViewController. It is very rare that this property will
need to be accessed externally. need to be accessed externally.
*/ */
open fileprivate(set) var leftView: View? open fileprivate(set) var leftView: UIView?
/** /**
A View property that is used to hide and reveal the A UIView property that is used to hide and reveal the
rightViewController. It is very rare that this property will rightViewController. It is very rare that this property will
need to be accessed externally. need to be accessed externally.
*/ */
open fileprivate(set) var rightView: View? open fileprivate(set) var rightView: UIView?
/// Indicates whether the leftView or rightView is opened. /// Indicates whether the leftView or rightView is opened.
open var isOpened: Bool { open var isOpened: Bool {
...@@ -428,7 +428,7 @@ open class NavigationDrawerController: RootController { ...@@ -428,7 +428,7 @@ open class NavigationDrawerController: RootController {
open override func layoutSubviews() { open override func layoutSubviews() {
toggleStatusBar() toggleStatusBar()
if let v: View = leftView { if let v = leftView {
v.width = leftViewWidth v.width = leftViewWidth
v.height = view.bounds.height v.height = view.bounds.height
leftViewThreshold = leftViewWidth / 2 leftViewThreshold = leftViewWidth / 2
...@@ -439,7 +439,7 @@ open class NavigationDrawerController: RootController { ...@@ -439,7 +439,7 @@ open class NavigationDrawerController: RootController {
} }
} }
if let v: View = rightView { if let v = rightView {
v.width = rightViewWidth v.width = rightViewWidth
v.height = view.bounds.height v.height = view.bounds.height
rightViewThreshold = view.bounds.width - rightViewWidth / 2 rightViewThreshold = view.bounds.width - rightViewWidth / 2
...@@ -947,7 +947,7 @@ open class NavigationDrawerController: RootController { ...@@ -947,7 +947,7 @@ open class NavigationDrawerController: RootController {
A method that shows a view. A method that shows a view.
- Parameter container: A container view. - Parameter container: A container view.
*/ */
fileprivate func showView(container: View) { fileprivate func showView(container: UIView) {
container.depthPreset = depthPreset container.depthPreset = depthPreset
container.isHidden = false container.isHidden = false
} }
...@@ -956,7 +956,7 @@ open class NavigationDrawerController: RootController { ...@@ -956,7 +956,7 @@ open class NavigationDrawerController: RootController {
A method that hides a view. A method that hides a view.
- Parameter container: A container view. - Parameter container: A container view.
*/ */
fileprivate func hideView(container: View) { fileprivate func hideView(container: UIView) {
container.depthPreset = .none container.depthPreset = .none
container.isHidden = true container.isHidden = true
} }
...@@ -997,7 +997,7 @@ extension NavigationDrawerController { ...@@ -997,7 +997,7 @@ extension NavigationDrawerController {
isLeftViewEnabled = true isLeftViewEnabled = true
leftViewWidth = .phone == Device.userInterfaceIdiom ? 280 : 320 leftViewWidth = .phone == Device.userInterfaceIdiom ? 280 : 320
leftView = View() leftView = UIView()
leftView!.frame = CGRect(x: 0, y: 0, width: leftViewWidth, height: view.height) leftView!.frame = CGRect(x: 0, y: 0, width: leftViewWidth, height: view.height)
leftView!.backgroundColor = nil leftView!.backgroundColor = nil
view.addSubview(leftView!) view.addSubview(leftView!)
...@@ -1017,7 +1017,7 @@ extension NavigationDrawerController { ...@@ -1017,7 +1017,7 @@ extension NavigationDrawerController {
isRightViewEnabled = true isRightViewEnabled = true
rightViewWidth = .phone == Device.userInterfaceIdiom ? 280 : 320 rightViewWidth = .phone == Device.userInterfaceIdiom ? 280 : 320
rightView = View() rightView = UIView()
rightView!.frame = CGRect(x: view.width, y: 0, width: rightViewWidth, height: view.height) rightView!.frame = CGRect(x: view.width, y: 0, width: rightViewWidth, height: view.height)
rightView!.backgroundColor = nil rightView!.backgroundColor = nil
view.addSubview(rightView!) view.addSubview(rightView!)
......
...@@ -191,6 +191,7 @@ extension RootController { ...@@ -191,6 +191,7 @@ extension RootController {
addChildViewController(v) addChildViewController(v)
container.addSubview(v.view) container.addSubview(v.view)
v.didMove(toParentViewController: self) v.didMove(toParentViewController: self)
v.view.frame = container.bounds
v.view.clipsToBounds = true v.view.clipsToBounds = true
v.view.autoresizingMask = [.flexibleWidth, .flexibleHeight] v.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
v.view.contentScaleFactor = Screen.scale v.view.contentScaleFactor = Screen.scale
......
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