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
64404da5
Commit
64404da5
authored
Aug 28, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue-7: updated SideNav options
parent
24efce53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Source/SideNavController.swift
+7
-7
No files found.
Source/SideNavController.swift
View file @
64404da5
...
...
@@ -78,9 +78,9 @@ public class SideNavController: MaterialViewController, UIGestureRecognizerDeleg
public
static
var
contentViewScale
:
CGFloat
=
1
public
static
var
contentViewOpacity
:
CGFloat
=
0.4
public
static
var
hideStatusBar
:
Bool
=
true
public
static
var
pointOfNoReturnWidth
:
CGFloat
=
48
public
static
var
pointOfNoReturnheight
:
CGFloat
=
48
public
static
var
backdrop
ViewContainer
BackgroundColor
:
UIColor
=
.
blackColor
()
public
static
var
horizontalThreshold
:
CGFloat
=
48
public
static
var
verticalThreshold
:
CGFloat
=
48
public
static
var
backdropBackgroundColor
:
UIColor
=
.
blackColor
()
public
static
var
animationDuration
:
CGFloat
=
0.5
public
static
var
leftBezelWidth
:
CGFloat
=
16
public
static
var
leftViewContainerWidth
:
CGFloat
=
240
...
...
@@ -689,7 +689,7 @@ public class SideNavController: MaterialViewController, UIGestureRecognizerDeleg
}
else
{
c
.
point
=
gesture
.
velocityInView
(
gesture
.
view
)
let
x
:
CGFloat
=
c
.
point
.
x
>=
1000
||
c
.
point
.
x
<=
-
1000
?
c
.
point
.
x
:
0
c
.
state
=
vc
.
frame
.
origin
.
x
<=
CGFloat
(
floor
(
leftOriginX
))
+
options
.
pointOfNoReturnWidth
||
c
.
point
.
x
<=
-
1000
?
.
Closed
:
.
Opened
c
.
state
=
vc
.
frame
.
origin
.
x
<=
CGFloat
(
floor
(
leftOriginX
))
+
options
.
horizontalThreshold
||
c
.
point
.
x
<=
-
1000
?
.
Closed
:
.
Opened
if
.
Closed
==
c
.
state
{
closeLeftViewContainer
(
velocity
:
x
)
}
else
{
...
...
@@ -738,7 +738,7 @@ public class SideNavController: MaterialViewController, UIGestureRecognizerDeleg
}
else
{
c
.
point
=
gesture
.
velocityInView
(
gesture
.
view
)
let
x
:
CGFloat
=
c
.
point
.
x
<=
-
1000
||
c
.
point
.
x
>=
1000
?
c
.
point
.
x
:
0
c
.
state
=
vc
.
frame
.
origin
.
x
>=
CGFloat
(
floor
(
rightOriginX
)
-
options
.
pointOfNoReturnWidth
)
||
c
.
point
.
x
>=
1000
?
.
Closed
:
.
Opened
c
.
state
=
vc
.
frame
.
origin
.
x
>=
CGFloat
(
floor
(
rightOriginX
)
-
options
.
horizontalThreshold
)
||
c
.
point
.
x
>=
1000
?
.
Closed
:
.
Opened
if
.
Closed
==
c
.
state
{
closeRightViewContainer
(
velocity
:
x
)
}
else
{
...
...
@@ -795,7 +795,7 @@ public class SideNavController: MaterialViewController, UIGestureRecognizerDeleg
if
let
c
=
bottomContainer
{
c
.
point
=
gesture
.
velocityInView
(
gesture
.
view
)
let
y
:
CGFloat
=
c
.
point
.
y
<=
-
1000
||
c
.
point
.
y
>=
1000
?
c
.
point
.
y
:
0
c
.
state
=
vc
.
frame
.
origin
.
y
>=
CGFloat
(
floor
(
bottomOriginY
)
-
options
.
pointOfNoReturnheight
)
||
c
.
point
.
y
>=
1000
?
.
Closed
:
.
Opened
c
.
state
=
vc
.
frame
.
origin
.
y
>=
CGFloat
(
floor
(
bottomOriginY
)
-
options
.
verticalThreshold
)
||
c
.
point
.
y
>=
1000
?
.
Closed
:
.
Opened
if
.
Closed
==
c
.
state
{
closeBottomViewContainer
(
velocity
:
y
)
}
else
{
...
...
@@ -947,7 +947,7 @@ public class SideNavController: MaterialViewController, UIGestureRecognizerDeleg
//
private
func
prepareBackdropContainer
()
{
backdropViewContainer
=
UIView
(
frame
:
view
.
bounds
)
backdropViewContainer
!.
backgroundColor
=
options
.
backdrop
ViewContainer
BackgroundColor
backdropViewContainer
!.
backgroundColor
=
options
.
backdropBackgroundColor
backdropViewContainer
!.
autoresizingMask
=
.
FlexibleHeight
|
.
FlexibleWidth
backdropViewContainer
!.
layer
.
opacity
=
0
view
.
addSubview
(
backdropViewContainer
!
)
...
...
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