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
7c7c0462
Commit
7c7c0462
authored
Jun 13, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated NavigationDrawerController with minor edits, in perparation for hiding/showing status bar
parent
5de32900
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
8 deletions
+19
-8
Examples/Programmatic/App/App/AppNavigationController.swift
+5
-1
Examples/Programmatic/App/App/Info.plist
+2
-0
Sources/iOS/NavigationBar.swift
+0
-1
Sources/iOS/NavigationDrawerController.swift
+12
-6
No files found.
Examples/Programmatic/App/App/AppNavigationController.swift
View file @
7c7c0462
...
@@ -37,9 +37,13 @@ class AppNavigationController: NavigationController {
...
@@ -37,9 +37,13 @@ class AppNavigationController: NavigationController {
prepareNavigationBar
()
prepareNavigationBar
()
}
}
override
func
viewWillAppear
(
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
navigationBar
.
statusBarStyle
=
.
LightContent
}
/// Prepares the navigationBar
/// Prepares the navigationBar
private
func
prepareNavigationBar
()
{
private
func
prepareNavigationBar
()
{
navigationBar
.
statusBarStyle
=
.
LightContent
navigationBar
.
tintColor
=
MaterialColor
.
white
navigationBar
.
tintColor
=
MaterialColor
.
white
navigationBar
.
backgroundColor
=
MaterialColor
.
blue
.
base
navigationBar
.
backgroundColor
=
MaterialColor
.
blue
.
base
}
}
...
...
Examples/Programmatic/App/App/Info.plist
View file @
7c7c0462
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
...
...
Sources/iOS/NavigationBar.swift
View file @
7c7c0462
...
@@ -425,7 +425,6 @@ public class NavigationBar : UINavigationBar {
...
@@ -425,7 +425,6 @@ public class NavigationBar : UINavigationBar {
when subclassing.
when subclassing.
*/
*/
public
func
prepareView
()
{
public
func
prepareView
()
{
barStyle
=
.
Black
translucent
=
false
translucent
=
false
depth
=
.
Depth1
depth
=
.
Depth1
spacingPreset
=
.
Spacing1
spacingPreset
=
.
Spacing1
...
...
Sources/iOS/NavigationDrawerController.swift
View file @
7c7c0462
...
@@ -1083,11 +1083,13 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
...
@@ -1083,11 +1083,13 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Shows the statusBar.
/// Shows the statusBar.
private
func
showStatusBar
()
{
private
func
showStatusBar
()
{
if
statusBarHidden
{
if
statusBarHidden
{
willHideStatusBar
=
false
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
animations
:
{
[
weak
self
]
in
animations
:
{
[
weak
self
]
in
self
?
.
statusBarHidden
=
false
if
let
s
:
NavigationDrawerController
=
self
{
self
?
.
setNeedsStatusBarAppearanceUpdate
()
s
.
statusBarHidden
=
false
s
.
willHideStatusBar
=
false
s
.
setNeedsStatusBarAppearanceUpdate
()
}
})
})
delegate
?
.
navigationDrawerStatusBarHiddenState
?(
self
,
hidden
:
false
)
delegate
?
.
navigationDrawerStatusBarHiddenState
?(
self
,
hidden
:
false
)
}
}
...
@@ -1096,12 +1098,14 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
...
@@ -1096,12 +1098,14 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Hides the statusBar.
/// Hides the statusBar.
private
func
hideStatusBar
()
{
private
func
hideStatusBar
()
{
if
enableHideStatusbar
{
if
enableHideStatusbar
{
willHideStatusBar
=
true
if
!
statusBarHidden
{
if
!
statusBarHidden
{
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
UIView
.
animateWithDuration
(
NSTimeInterval
(
UINavigationControllerHideShowBarDuration
),
animations
:
{
[
weak
self
]
in
animations
:
{
[
weak
self
]
in
self
?
.
statusBarHidden
=
true
if
let
s
:
NavigationDrawerController
=
self
{
self
?
.
setNeedsStatusBarAppearanceUpdate
()
s
.
statusBarHidden
=
true
s
.
willHideStatusBar
=
true
s
.
setNeedsStatusBarAppearanceUpdate
()
}
})
})
delegate
?
.
navigationDrawerStatusBarHiddenState
?(
self
,
hidden
:
true
)
delegate
?
.
navigationDrawerStatusBarHiddenState
?(
self
,
hidden
:
true
)
}
}
...
@@ -1177,6 +1181,8 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
...
@@ -1177,6 +1181,8 @@ public class NavigationDrawerController : UIViewController, UIGestureRecognizerD
/// Layout subviews.
/// Layout subviews.
private
func
layoutSubviews
()
{
private
func
layoutSubviews
()
{
rootViewController
.
view
.
frame
=
view
.
bounds
if
let
v
:
MaterialView
=
leftView
{
if
let
v
:
MaterialView
=
leftView
{
v
.
width
=
leftViewWidth
v
.
width
=
leftViewWidth
v
.
height
=
view
.
bounds
.
height
v
.
height
=
view
.
bounds
.
height
...
...
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