Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
0029c656
Commit
0029c656
authored
Nov 14, 2015
by
danieldahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated SideNav dimension resize when cell-phone status is on
parent
bfe9ed9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
Source/SideNavigationViewController.swift
+15
-19
No files found.
Source/SideNavigationViewController.swift
View file @
0029c656
...
@@ -166,10 +166,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -166,10 +166,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
override
func
viewWillLayoutSubviews
()
{
public
override
func
viewWillLayoutSubviews
()
{
super
.
viewWillLayoutSubviews
()
super
.
viewWillLayoutSubviews
()
layoutBackdropLayer
()
layoutBackdropLayer
()
if
let
v
:
MaterialView
=
sideView
{
sideView
.
height
=
view
.
bounds
.
height
sideViewController
?
.
view
.
frame
=
v
.
bounds
sideViewController
.
view
.
frame
.
size
.
width
=
sideView
.
width
sideViewController
?
.
view
.
center
=
CGPointMake
(
v
.
width
/
2
,
v
.
height
/
2
)
sideViewController
.
view
.
frame
.
size
.
height
=
sideView
.
height
}
sideViewController
.
view
.
center
=
CGPointMake
(
sideView
.
width
/
2
,
sideView
.
height
/
2
)
}
}
/**
/**
...
@@ -184,7 +184,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -184,7 +184,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
MaterialAnimation
.
animationWithDuration
(
0.25
,
animations
:
{
MaterialAnimation
.
animationWithDuration
(
0.25
,
animations
:
{
self
.
sideView
.
width
=
width
self
.
sideView
.
width
=
width
self
.
sideView
.
position
.
x
=
w
self
.
sideView
.
position
.
x
=
w
})
{
})
{
self
.
userInteractionEnabled
=
false
self
.
userInteractionEnabled
=
false
}
}
}
else
{
}
else
{
...
@@ -206,13 +206,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -206,13 +206,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
:name: open
:name: open
*/
*/
public
func
open
(
velocity
:
CGFloat
=
0
)
{
public
func
open
(
velocity
:
CGFloat
=
0
)
{
let
w
:
CGFloat
=
sideView
.
width
let
h
:
CGFloat
=
sideView
.
height
let
d
:
Double
=
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
))))
toggleStatusBar
(
true
)
toggleStatusBar
(
true
)
MaterialAnimation
.
animationWithDuration
(
d
,
animations
:
{
MaterialAnimation
.
animationWithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
self
.
sideView
.
position
=
CGPointMake
(
w
/
2
,
h
/
2
)
animations
:
{
self
.
sideView
.
position
=
CGPointMake
(
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
self
.
backdropLayer
.
hidden
=
false
self
.
backdropLayer
.
hidden
=
false
})
{
})
{
self
.
userInteractionEnabled
=
false
self
.
userInteractionEnabled
=
false
...
@@ -223,13 +220,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -223,13 +220,10 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
:name: close
:name: close
*/
*/
public
func
close
(
velocity
:
CGFloat
=
0
)
{
public
func
close
(
velocity
:
CGFloat
=
0
)
{
let
w
:
CGFloat
=
sideView
.
width
let
h
:
CGFloat
=
sideView
.
height
let
d
:
Double
=
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
))))
toggleStatusBar
(
false
)
toggleStatusBar
(
false
)
MaterialAnimation
.
animationWithDuration
(
d
,
animations
:
{
MaterialAnimation
.
animationWithDuration
(
Double
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
sideView
.
x
/
velocity
)))),
self
.
sideView
.
position
=
CGPointMake
(
-
w
/
2
,
h
/
2
)
animations
:
{
self
.
sideView
.
position
=
CGPointMake
(
-
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
self
.
backdropLayer
.
hidden
=
true
self
.
backdropLayer
.
hidden
=
true
})
{
})
{
self
.
userInteractionEnabled
=
true
self
.
userInteractionEnabled
=
true
...
@@ -281,6 +275,8 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -281,6 +275,8 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
//
//
internal
func
prepareMainView
()
{
internal
func
prepareMainView
()
{
prepareViewControllerWithinContainer
(
mainViewController
,
container
:
view
)
prepareViewControllerWithinContainer
(
mainViewController
,
container
:
view
)
mainViewController
.
view
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignToParent
(
view
,
child
:
mainViewController
.
view
)
}
}
//
//
...
@@ -290,6 +286,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -290,6 +286,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
// container
// container
sideView
.
frame
=
CGRectMake
(
0
,
0
,
sideViewControllerWidth
,
view
.
frame
.
height
)
sideView
.
frame
=
CGRectMake
(
0
,
0
,
sideViewControllerWidth
,
view
.
frame
.
height
)
sideView
.
backgroundColor
=
MaterialColor
.
blue
.
accent3
sideView
.
backgroundColor
=
MaterialColor
.
blue
.
accent3
sideView
.
autoresizesSubviews
=
true
view
.
addSubview
(
sideView
)
view
.
addSubview
(
sideView
)
MaterialAnimation
.
animationDisabled
({
MaterialAnimation
.
animationDisabled
({
...
@@ -297,7 +294,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -297,7 +294,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
self
.
sideView
.
zPosition
=
1000
self
.
sideView
.
zPosition
=
1000
})
})
prepareViewControllerWithinContainer
(
sideViewController
!
,
container
:
sideView
)
prepareViewControllerWithinContainer
(
sideViewController
,
container
:
sideView
)
// gestures
// gestures
prepareGestures
()
prepareGestures
()
...
@@ -422,7 +419,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
...
@@ -422,7 +419,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
// :name: prepareViewControllerWithinContainer
// :name: prepareViewControllerWithinContainer
//
//
private
func
prepareViewControllerWithinContainer
(
controller
:
UIViewController
,
container
:
UIView
)
{
private
func
prepareViewControllerWithinContainer
(
controller
:
UIViewController
,
container
:
UIView
)
{
controller
.
view
.
clipsToBounds
=
true
addChildViewController
(
controller
)
addChildViewController
(
controller
)
container
.
addSubview
(
controller
.
view
)
container
.
addSubview
(
controller
.
view
)
controller
.
didMoveToParentViewController
(
self
)
controller
.
didMoveToParentViewController
(
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment