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
76b54ae7
Commit
76b54ae7
authored
Nov 15, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unnecessary Theme settings
parent
12cb5f8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
73 deletions
+36
-73
Source/MaterialTheme.swift
+0
-68
Source/SideNavigationViewController.swift
+36
-5
No files found.
Source/MaterialTheme.swift
View file @
76b54ae7
...
...
@@ -24,8 +24,6 @@ public struct MaterialTheme {
public
struct
basicCardView
{}
public
struct
imageCardView
{}
public
struct
navigationBarView
{}
public
struct
searchBarView
{}
public
struct
pulseCollectionView
{}
public
struct
textLayer
{}
public
struct
label
{}
public
struct
flatButton
{}
...
...
@@ -206,72 +204,6 @@ public extension MaterialTheme.navigationBarView {
public
static
var
zPosition
:
CGFloat
=
100
}
// searchBarView
public
extension
MaterialTheme
.
searchBarView
{
// frame
public
static
var
x
:
CGFloat
=
0
public
static
var
y
:
CGFloat
=
0
public
static
var
width
:
CGFloat
=
UIScreen
.
mainScreen
()
.
bounds
.
width
public
static
var
height
:
CGFloat
=
70
// shadow
public
static
var
shadowDepth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
public
static
var
contentInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
Square2
)
public
static
var
textFieldInsetsRef
:
MaterialInsetsType
=
(
top
:
20
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
leftButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
rightButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
// border
public
static
var
borderWidth
:
MaterialBorder
=
.
None
public
static
var
bordercolor
:
UIColor
=
MaterialColor
.
black
// color
public
static
var
backgroundColor
:
UIColor
=
MaterialColor
.
white
// interaction
public
static
var
userInteractionEnabled
:
Bool
=
true
// image
public
static
var
contentsRect
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
var
contentsCenter
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
var
contentsScale
:
CGFloat
=
UIScreen
.
mainScreen
()
.
scale
public
static
var
contentsGravity
:
MaterialGravity
=
.
ResizeAspectFill
// position
public
static
var
zPosition
:
CGFloat
=
100
}
// pulseCollectionView
public
extension
MaterialTheme
.
pulseCollectionView
{
// shadow
public
static
var
shadowDepth
:
MaterialDepth
=
.
None
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// border
public
static
var
borderWidth
:
MaterialBorder
=
.
None
public
static
var
bordercolor
:
UIColor
=
MaterialColor
.
black
// color
public
static
var
backgroundColor
:
UIColor
=
MaterialColor
.
white
public
static
var
pulseColor
:
UIColor
=
MaterialColor
.
blueGrey
.
lighten4
public
static
var
pulseColorOpacity
:
CGFloat
=
0.25
// interaction
public
static
var
userInteractionEnabled
:
Bool
=
true
// image
public
static
var
contentsRect
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
var
contentsCenter
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
var
contentsScale
:
CGFloat
=
UIScreen
.
mainScreen
()
.
scale
public
static
var
contentsGravity
:
MaterialGravity
=
.
ResizeAspectFill
// position
public
static
var
zPosition
:
CGFloat
=
0
}
// textLayer
public
extension
MaterialTheme
.
textLayer
{
// scale
...
...
Source/SideNavigationViewController.swift
View file @
76b54ae7
...
...
@@ -42,11 +42,6 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
private
lazy
var
originalPosition
:
CGPoint
=
CGPointZero
//
// :name: sideView
//
private
lazy
var
sideView
:
MaterialView
=
MaterialView
()
//
// :name: sidePanGesture
//
internal
var
sidePanGesture
:
UIPanGestureRecognizer
?
...
...
@@ -96,11 +91,38 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
lazy
var
hideStatusBar
:
Bool
=
true
/**
:name: enableShadowDepth
*/
public
var
enableShadowDepth
:
Bool
=
true
{
didSet
{
if
!
enableShadowDepth
{
sideView
.
shadowDepth
=
.
None
}
}
}
/**
:name: shadowDepth
*/
public
var
shadowDepth
:
MaterialDepth
=
.
Depth2
{
didSet
{
if
!
enableShadowDepth
&&
.
None
!=
sideView
.
shadowDepth
{
sideView
.
shadowDepth
=
shadowDepth
}
}
}
/**
:name: backdropLayer
*/
public
private(set)
lazy
var
backdropLayer
:
CAShapeLayer
=
CAShapeLayer
()
/**
:name: sideView
*/
public
private(set)
lazy
var
sideView
:
MaterialView
=
MaterialView
()
/**
:name: backdropOpacity
*/
public
var
backdropOpacity
:
CGFloat
=
0.5
{
...
...
@@ -207,6 +229,9 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
self
.
sideView
.
position
=
CGPointMake
(
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
})
{
self
.
userInteractionEnabled
=
false
if
self
.
enableShadowDepth
{
self
.
sideView
.
shadowDepth
=
self
.
shadowDepth
}
}
}
...
...
@@ -221,6 +246,9 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
self
.
sideView
.
position
=
CGPointMake
(
-
self
.
sideView
.
width
/
2
,
self
.
sideView
.
height
/
2
)
})
{
self
.
userInteractionEnabled
=
true
if
self
.
enableShadowDepth
{
self
.
sideView
.
shadowDepth
=
.
None
}
}
}
...
...
@@ -297,6 +325,9 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
internal
func
handlePanGesture
(
recognizer
:
UIPanGestureRecognizer
)
{
switch
recognizer
.
state
{
case
.
Began
:
if
enableShadowDepth
{
sideView
.
shadowDepth
=
shadowDepth
}
backdropLayer
.
hidden
=
false
originalPosition
=
sideView
.
position
toggleStatusBar
(
true
)
...
...
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