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
dadbbd33
Commit
dadbbd33
authored
Mar 16, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue-220
parent
b1f7f4c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
Sources/NavigationBar.swift
+6
-3
Sources/NavigationItem.swift
+2
-1
Sources/SideNavigationViewController.swift
+7
-5
No files found.
Sources/NavigationBar.swift
View file @
dadbbd33
...
...
@@ -294,9 +294,11 @@ public class NavigationBar : UINavigationBar {
// Set the titleView if title is empty.
if
""
==
item
.
title
{
item
.
titleView
=
UIView
(
frame
:
CGRectMake
(
0
,
contentInset
.
top
,
MaterialDevice
.
width
<
MaterialDevice
.
height
?
MaterialDevice
.
height
:
MaterialDevice
.
width
,
intrinsicContentSize
()
.
height
-
contentInset
.
top
-
contentInset
.
bottom
))
item
.
titleView
!.
autoresizingMask
=
[
.
FlexibleWidth
]
item
.
titleView
!.
grid
.
axis
.
direction
=
.
Vertical
if
nil
==
item
.
titleView
{
item
.
titleView
=
UIView
(
frame
:
CGRectMake
(
0
,
contentInset
.
top
,
MaterialDevice
.
width
<
MaterialDevice
.
height
?
MaterialDevice
.
height
:
MaterialDevice
.
width
,
intrinsicContentSize
()
.
height
-
contentInset
.
top
-
contentInset
.
bottom
))
item
.
titleView
!.
autoresizingMask
=
[
.
FlexibleWidth
]
item
.
titleView
!.
grid
.
axis
.
direction
=
.
Vertical
}
// TitleView alignment.
if
let
t
:
UILabel
=
item
.
titleLabel
{
...
...
@@ -352,6 +354,7 @@ public class NavigationBar : UINavigationBar {
leftSpacer
.
width
=
inset
+
contentInset
.
left
}
item
.
titleView
?
.
frame
.
size
.
width
=
width
item
.
titleView
?
.
frame
.
size
.
height
=
height
-
contentInset
.
top
-
contentInset
.
bottom
if
let
t
:
UILabel
=
item
.
titleLabel
{
...
...
Sources/NavigationItem.swift
View file @
dadbbd33
...
...
@@ -34,9 +34,10 @@ import UIKit
private
var
NavigationItemKey
:
UInt8
=
0
public
class
NavigationItem
{
///
I
nset.
///
Portrait i
nset.
public
var
portraitInset
:
CGFloat
/// Landscape inset.
public
var
landscapeInset
:
CGFloat
/// Detail View.
...
...
Sources/SideNavigationViewController.swift
View file @
dadbbd33
...
...
@@ -140,7 +140,8 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
leftView is closed. The leftViewThreshold is always at half
the width of the leftView.
*/
@IBInspectable
public
var
leftViewThreshold
:
CGFloat
=
0
@IBInspectable
public
var
leftThreshold
:
CGFloat
?
private
var
leftViewThreshold
:
CGFloat
=
0
/**
A CGFloat property that accesses the rightView threshold of
...
...
@@ -150,7 +151,8 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
rightView is opened. The rightViewThreshold is always at half
the width of the rightView.
*/
@IBInspectable
public
var
rightViewThreshold
:
CGFloat
=
0
@IBInspectable
public
var
rightThreshold
:
CGFloat
?
private
var
rightViewThreshold
:
CGFloat
=
0
/**
A SideNavigationControllerDelegate property used to bind
...
...
@@ -865,7 +867,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// Toggles the statusBar
private
func
toggleStatusBar
()
{
if
MaterialDevice
.
landscape
&&
.
iPhone
==
MaterialDevice
.
type
{
if
opened
||
MaterialDevice
.
landscape
&&
.
iPhone
==
MaterialDevice
.
type
{
hideStatusBar
()
}
else
{
showStatusBar
()
...
...
@@ -939,7 +941,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if
let
v
:
MaterialView
=
leftView
{
v
.
width
=
leftViewWidth
v
.
height
=
view
.
bounds
.
height
leftViewThreshold
=
leftViewWidth
/
2
leftViewThreshold
=
nil
==
leftThreshold
?
leftViewWidth
/
2
:
leftThreshold
!
if
let
vc
:
UIViewController
=
leftViewController
{
vc
.
view
.
frame
.
size
.
width
=
v
.
width
vc
.
view
.
frame
.
size
.
height
=
v
.
height
...
...
@@ -950,7 +952,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
if
let
v
:
MaterialView
=
rightView
{
v
.
width
=
rightViewWidth
v
.
height
=
view
.
bounds
.
height
rightViewThreshold
=
view
.
bounds
.
width
-
rightViewWidth
/
2
rightViewThreshold
=
nil
==
rightThreshold
?
view
.
bounds
.
width
-
rightViewWidth
/
2
:
view
.
bounds
.
width
-
rightThreshold
!
if
let
vc
:
UIViewController
=
rightViewController
{
vc
.
view
.
frame
.
size
.
width
=
v
.
width
vc
.
view
.
frame
.
size
.
height
=
v
.
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