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
bdd87452
Commit
bdd87452
authored
Dec 21, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated shadowDepth property to depth
parent
65c7a1e6
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
55 additions
and
61 deletions
+55
-61
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
+2
-2
Examples/Programmatic/MaterialLayer/MaterialLayer/ViewController.swift
+1
-1
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
+1
-1
Examples/Programmatic/MaterialView/MaterialView/ViewController.swift
+1
-1
Examples/Storyboards/MaterialPulseView/MaterialPulseView/ViewController.swift
+1
-1
Sources/CaptureView.swift
+1
-1
Sources/CardView.swift
+1
-1
Sources/FabButton.swift
+1
-1
Sources/FlatButton.swift
+1
-1
Sources/ImageCardView.swift
+1
-1
Sources/MaterialButton.swift
+5
-5
Sources/MaterialLayer.swift
+6
-6
Sources/MaterialPulseView.swift
+1
-1
Sources/MaterialTheme.swift
+9
-9
Sources/MaterialView.swift
+13
-19
Sources/NavigationBarView.swift
+1
-1
Sources/RaisedButton.swift
+1
-1
Sources/SideNavigationViewController.swift
+8
-8
No files found.
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
View file @
bdd87452
...
...
@@ -229,7 +229,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
*/
private
func
prepareNavigationBarView
()
{
navigationBarView
.
backgroundColor
=
nil
navigationBarView
.
shadowD
epth
=
.
None
navigationBarView
.
d
epth
=
.
None
navigationBarView
.
statusBarStyle
=
.
LightContent
// Title label.
...
...
@@ -270,7 +270,7 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
captureButton
.
backgroundColor
=
MaterialColor
.
red
.
darken1
.
colorWithAlphaComponent
(
0.3
)
captureButton
.
borderWidth
=
.
Border2
captureButton
.
borderColor
=
MaterialColor
.
white
captureButton
.
shadowD
epth
=
.
None
captureButton
.
d
epth
=
.
None
captureView
.
captureButton
=
captureButton
}
...
...
Examples/Programmatic/MaterialLayer/MaterialLayer/ViewController.swift
View file @
bdd87452
...
...
@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let
materialLayer
:
MaterialLayer
=
MaterialLayer
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
materialLayer
.
image
=
UIImage
(
named
:
"CosmicMindAppIcon"
)
materialLayer
.
shape
=
.
Circle
materialLayer
.
shadowD
epth
=
.
Depth2
materialLayer
.
d
epth
=
.
Depth2
// Add layer to UIViewController.
view
.
layer
.
addSublayer
(
materialLayer
)
...
...
Examples/Programmatic/MaterialPulseView/MaterialPulseView/ViewController.swift
View file @
bdd87452
...
...
@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let
pulseView
:
MaterialPulseView
=
MaterialPulseView
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
pulseView
.
image
=
UIImage
(
named
:
"ContentAppIcon"
)
pulseView
.
shape
=
.
Circle
pulseView
.
shadowD
epth
=
.
Depth2
pulseView
.
d
epth
=
.
Depth2
// Add view to UIViewController.
view
.
addSubview
(
pulseView
)
...
...
Examples/Programmatic/MaterialView/MaterialView/ViewController.swift
View file @
bdd87452
...
...
@@ -44,7 +44,7 @@ class ViewController: UIViewController {
let
materialView
:
MaterialView
=
MaterialView
(
frame
:
CGRectMake
(
132
,
132
,
150
,
150
))
materialView
.
image
=
UIImage
(
named
:
"FocusAppIcon"
)
materialView
.
shape
=
.
Square
materialView
.
shadowD
epth
=
.
Depth2
materialView
.
d
epth
=
.
Depth2
materialView
.
cornerRadius
=
.
Radius3
// Add view to UIViewController.
...
...
Examples/Storyboards/MaterialPulseView/MaterialPulseView/ViewController.swift
View file @
bdd87452
...
...
@@ -45,7 +45,7 @@ class ViewController: UIViewController {
private
func
prepareGeneralMaterialPulseViewExample
()
{
pulseView
.
image
=
UIImage
(
named
:
"ContentAppIcon"
)
pulseView
.
shape
=
.
Circle
pulseView
.
shadowD
epth
=
.
Depth2
pulseView
.
d
epth
=
.
Depth2
}
}
Sources/CaptureView.swift
View file @
bdd87452
...
...
@@ -315,7 +315,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
contentsCenter
=
MaterialTheme
.
captureView
.
contentsCenter
contentsScale
=
MaterialTheme
.
captureView
.
contentsScale
contentsGravity
=
MaterialTheme
.
captureView
.
contentsGravity
shadowDepth
=
MaterialTheme
.
captureView
.
shadowD
epth
depth
=
MaterialTheme
.
captureView
.
d
epth
shadowColor
=
MaterialTheme
.
captureView
.
shadowColor
zPosition
=
MaterialTheme
.
captureView
.
zPosition
borderWidth
=
MaterialTheme
.
captureView
.
borderWidth
...
...
Sources/CardView.swift
View file @
bdd87452
...
...
@@ -402,7 +402,7 @@ public class CardView : MaterialPulseView {
contentsCenter
=
MaterialTheme
.
basicCardView
.
contentsCenter
contentsScale
=
MaterialTheme
.
basicCardView
.
contentsScale
contentsGravity
=
MaterialTheme
.
basicCardView
.
contentsGravity
shadowDepth
=
MaterialTheme
.
basicCardView
.
shadowD
epth
depth
=
MaterialTheme
.
basicCardView
.
d
epth
shadowColor
=
MaterialTheme
.
basicCardView
.
shadowColor
zPosition
=
MaterialTheme
.
basicCardView
.
zPosition
borderWidth
=
MaterialTheme
.
basicCardView
.
borderWidth
...
...
Sources/FabButton.swift
View file @
bdd87452
...
...
@@ -32,7 +32,7 @@ public class FabButton : MaterialButton {
pulseColorOpacity
=
MaterialTheme
.
fabButton
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
fabButton
.
pulseColor
shadowDepth
=
MaterialTheme
.
fabButton
.
shadowD
epth
depth
=
MaterialTheme
.
fabButton
.
d
epth
shadowColor
=
MaterialTheme
.
fabButton
.
shadowColor
zPosition
=
MaterialTheme
.
fabButton
.
zPosition
borderWidth
=
MaterialTheme
.
fabButton
.
borderWidth
...
...
Sources/FlatButton.swift
View file @
bdd87452
...
...
@@ -32,7 +32,7 @@ public class FlatButton : MaterialButton {
pulseColorOpacity
=
MaterialTheme
.
flatButton
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
flatButton
.
pulseColor
shadowDepth
=
MaterialTheme
.
flatButton
.
shadowD
epth
depth
=
MaterialTheme
.
flatButton
.
d
epth
shadowColor
=
MaterialTheme
.
flatButton
.
shadowColor
zPosition
=
MaterialTheme
.
flatButton
.
zPosition
cornerRadius
=
MaterialTheme
.
flatButton
.
cornerRadius
...
...
Sources/ImageCardView.swift
View file @
bdd87452
...
...
@@ -539,7 +539,7 @@ public class ImageCardView : MaterialPulseView {
contentsCenter
=
MaterialTheme
.
imageCardView
.
contentsCenter
contentsScale
=
MaterialTheme
.
imageCardView
.
contentsScale
contentsGravity
=
MaterialTheme
.
imageCardView
.
contentsGravity
shadowDepth
=
MaterialTheme
.
imageCardView
.
shadowD
epth
depth
=
MaterialTheme
.
imageCardView
.
d
epth
shadowColor
=
MaterialTheme
.
imageCardView
.
shadowColor
zPosition
=
MaterialTheme
.
imageCardView
.
zPosition
borderWidth
=
MaterialTheme
.
imageCardView
.
borderWidth
...
...
Sources/MaterialButton.swift
View file @
bdd87452
...
...
@@ -201,11 +201,11 @@ public class MaterialButton : UIButton {
}
/**
:name:
shadowD
epth
:name:
d
epth
*/
public
var
shadowD
epth
:
MaterialDepth
{
public
var
d
epth
:
MaterialDepth
{
didSet
{
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
shadowD
epth
)
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
d
epth
)
shadowOffset
=
value
.
offset
shadowOpacity
=
value
.
opacity
shadowRadius
=
value
.
radius
...
...
@@ -298,7 +298,7 @@ public class MaterialButton : UIButton {
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
borderWidth
=
.
None
shadowD
epth
=
.
None
d
epth
=
.
None
shape
=
.
None
contentInsets
=
.
None
super
.
init
(
coder
:
aDecoder
)
...
...
@@ -310,7 +310,7 @@ public class MaterialButton : UIButton {
*/
public
override
init
(
frame
:
CGRect
)
{
borderWidth
=
.
None
shadowD
epth
=
.
None
d
epth
=
.
None
shape
=
.
None
contentInsets
=
.
None
super
.
init
(
frame
:
frame
)
...
...
Sources/MaterialLayer.swift
View file @
bdd87452
...
...
@@ -143,11 +143,11 @@ public class MaterialLayer : CAShapeLayer {
}
/**
:name:
shadowD
epth
:name:
d
epth
*/
public
var
shadowD
epth
:
MaterialDepth
{
public
var
d
epth
:
MaterialDepth
{
didSet
{
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
shadowD
epth
)
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
d
epth
)
shadowOffset
=
value
.
offset
shadowOpacity
=
value
.
opacity
shadowRadius
=
value
.
radius
...
...
@@ -185,7 +185,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
shape
=
.
None
shadowD
epth
=
.
None
d
epth
=
.
None
super
.
init
(
coder
:
aDecoder
)
prepareVisualLayer
()
}
...
...
@@ -195,7 +195,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public
override
init
(
layer
:
AnyObject
)
{
shape
=
.
None
shadowD
epth
=
.
None
d
epth
=
.
None
super
.
init
()
prepareVisualLayer
()
}
...
...
@@ -205,7 +205,7 @@ public class MaterialLayer : CAShapeLayer {
*/
public
override
init
()
{
shape
=
.
None
shadowD
epth
=
.
None
d
epth
=
.
None
super
.
init
()
prepareVisualLayer
()
}
...
...
Sources/MaterialPulseView.swift
View file @
bdd87452
...
...
@@ -143,7 +143,7 @@ public class MaterialPulseView : MaterialView {
contentsCenter
=
MaterialTheme
.
pulseView
.
contentsCenter
contentsScale
=
MaterialTheme
.
pulseView
.
contentsScale
contentsGravity
=
MaterialTheme
.
pulseView
.
contentsGravity
shadowDepth
=
MaterialTheme
.
pulseView
.
shadowD
epth
depth
=
MaterialTheme
.
pulseView
.
d
epth
shadowColor
=
MaterialTheme
.
pulseView
.
shadowColor
zPosition
=
MaterialTheme
.
pulseView
.
zPosition
borderWidth
=
MaterialTheme
.
pulseView
.
borderWidth
...
...
Sources/MaterialTheme.swift
View file @
bdd87452
...
...
@@ -35,7 +35,7 @@ public struct MaterialTheme {
// view
public
extension
MaterialTheme
.
view
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
None
public
static
var
d
epth
:
MaterialDepth
=
.
None
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// border
...
...
@@ -61,7 +61,7 @@ public extension MaterialTheme.view {
// pulseView
public
extension
MaterialTheme
.
pulseView
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
None
public
static
var
d
epth
:
MaterialDepth
=
.
None
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// border
...
...
@@ -89,7 +89,7 @@ public extension MaterialTheme.pulseView {
// basicCardView
public
extension
MaterialTheme
.
basicCardView
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
public
static
var
d
epth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -129,7 +129,7 @@ public extension MaterialTheme.basicCardView {
// imageCardView
public
extension
MaterialTheme
.
imageCardView
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
public
static
var
d
epth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -175,7 +175,7 @@ public extension MaterialTheme.navigationBarView {
public
static
var
height
:
CGFloat
=
70
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
public
static
var
d
epth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -208,7 +208,7 @@ public extension MaterialTheme.navigationBarView {
// captureView
public
extension
MaterialTheme
.
captureView
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
None
public
static
var
d
epth
:
MaterialDepth
=
.
None
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -267,7 +267,7 @@ public extension MaterialTheme.label {
// flatButton
public
extension
MaterialTheme
.
flatButton
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
None
public
static
var
d
epth
:
MaterialDepth
=
.
None
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -298,7 +298,7 @@ public extension MaterialTheme.flatButton {
// raisedButton
public
extension
MaterialTheme
.
raisedButton
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
public
static
var
d
epth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
@@ -330,7 +330,7 @@ public extension MaterialTheme.raisedButton {
// fabButton
public
extension
MaterialTheme
.
fabButton
{
// shadow
public
static
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
public
static
var
d
epth
:
MaterialDepth
=
.
Depth2
public
static
var
shadowColor
:
UIColor
=
MaterialColor
.
black
// shape
...
...
Sources/MaterialView.swift
View file @
bdd87452
...
...
@@ -36,7 +36,7 @@ public class MaterialView : UIView {
/**
An optional property that sets an image to the visualLayer's
contents. Images should not be set to the backing layer's
contents
property
. Images should not be set to the backing layer's
contents property to avoid conflicts when using clipsToBounds.
*/
public
var
image
:
UIImage
?
{
...
...
@@ -100,7 +100,7 @@ public class MaterialView : UIView {
}
}
/// An
Optional value that set'
s the backing layer's backgroundColor.
/// An
optional property that accesse
s the backing layer's backgroundColor.
public
override
var
backgroundColor
:
UIColor
?
{
didSet
{
layer
.
backgroundColor
=
backgroundColor
?
.
CGColor
...
...
@@ -163,18 +163,14 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowColor
*/
/// An optional property that accesses the backing layer's shadowColor.
public
var
shadowColor
:
UIColor
?
{
didSet
{
layer
.
shadowColor
=
shadowColor
?
.
CGColor
}
}
/**
:name: shadowOffset
*/
/// A property that accesses the backing layer's shadowOffset.
public
var
shadowOffset
:
CGSize
{
get
{
return
layer
.
shadowOffset
...
...
@@ -184,9 +180,7 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowOpacity
*/
/// A property that accesses the backing layer's shadowOpacity.
public
var
shadowOpacity
:
Float
{
get
{
return
layer
.
shadowOpacity
...
...
@@ -196,9 +190,7 @@ public class MaterialView : UIView {
}
}
/**
:name: shadowRadius
*/
/// A property that accesses the backing layer's shadowRadius.
public
var
shadowRadius
:
CGFloat
{
get
{
return
layer
.
shadowRadius
...
...
@@ -209,11 +201,13 @@ public class MaterialView : UIView {
}
/**
:name: shadowDepth
A convenience property that sets the shadowOffset, shadowOpacity, and
shadowRadius for the backing layer. This is the preferred method of
setting depth in order to maintain consitency across UI objects.
*/
public
var
shadowD
epth
:
MaterialDepth
{
public
var
d
epth
:
MaterialDepth
{
didSet
{
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
shadowD
epth
)
let
value
:
MaterialDepthType
=
MaterialDepthToValue
(
d
epth
)
shadowOffset
=
value
.
offset
shadowOpacity
=
value
.
opacity
shadowRadius
=
value
.
radius
...
...
@@ -300,7 +294,7 @@ public class MaterialView : UIView {
contentsScale
=
MaterialTheme
.
view
.
contentsScale
contentsGravity
=
MaterialTheme
.
view
.
contentsGravity
borderWidth
=
MaterialTheme
.
view
.
borderWidth
shadowDepth
=
MaterialTheme
.
view
.
shadowD
epth
depth
=
MaterialTheme
.
view
.
d
epth
shape
=
.
None
cornerRadius
=
.
None
super
.
init
(
coder
:
aDecoder
)
...
...
@@ -316,7 +310,7 @@ public class MaterialView : UIView {
contentsScale
=
MaterialTheme
.
view
.
contentsScale
contentsGravity
=
MaterialTheme
.
view
.
contentsGravity
borderWidth
=
MaterialTheme
.
view
.
borderWidth
shadowDepth
=
MaterialTheme
.
view
.
shadowD
epth
depth
=
MaterialTheme
.
view
.
d
epth
shape
=
.
None
cornerRadius
=
.
None
super
.
init
(
frame
:
frame
)
...
...
Sources/NavigationBarView.swift
View file @
bdd87452
...
...
@@ -327,7 +327,7 @@ public class NavigationBarView : MaterialView {
contentsCenter
=
MaterialTheme
.
navigationBarView
.
contentsCenter
contentsScale
=
MaterialTheme
.
navigationBarView
.
contentsScale
contentsGravity
=
MaterialTheme
.
navigationBarView
.
contentsGravity
shadowDepth
=
MaterialTheme
.
navigationBarView
.
shadowD
epth
depth
=
MaterialTheme
.
navigationBarView
.
d
epth
shadowColor
=
MaterialTheme
.
navigationBarView
.
shadowColor
zPosition
=
MaterialTheme
.
navigationBarView
.
zPosition
borderWidth
=
MaterialTheme
.
navigationBarView
.
borderWidth
...
...
Sources/RaisedButton.swift
View file @
bdd87452
...
...
@@ -32,7 +32,7 @@ public class RaisedButton : MaterialButton {
pulseColorOpacity
=
MaterialTheme
.
raisedButton
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
raisedButton
.
pulseColor
shadowDepth
=
MaterialTheme
.
raisedButton
.
shadowD
epth
depth
=
MaterialTheme
.
raisedButton
.
d
epth
shadowColor
=
MaterialTheme
.
raisedButton
.
shadowColor
zPosition
=
MaterialTheme
.
raisedButton
.
zPosition
cornerRadius
=
MaterialTheme
.
raisedButton
.
cornerRadius
...
...
Sources/SideNavigationViewController.swift
View file @
bdd87452
...
...
@@ -137,18 +137,18 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
public
var
enableShadowDepth
:
Bool
=
true
{
didSet
{
if
!
enableShadowDepth
{
sideView
.
shadowD
epth
=
.
None
sideView
.
d
epth
=
.
None
}
}
}
/**
:name:
shadowD
epth
:name:
d
epth
*/
public
var
shadowD
epth
:
MaterialDepth
=
.
Depth2
{
public
var
d
epth
:
MaterialDepth
=
.
Depth2
{
didSet
{
if
!
enableShadowDepth
&&
.
None
!=
sideView
.
shadowD
epth
{
sideView
.
shadowDepth
=
shadowD
epth
if
!
enableShadowDepth
&&
.
None
!=
sideView
.
d
epth
{
sideView
.
depth
=
d
epth
}
}
}
...
...
@@ -297,7 +297,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
if
self
.
enableShadowDepth
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
,
unowned
sideView
=
self
.
sideView
]
in
sideView
.
shadowDepth
=
self
.
shadowD
epth
sideView
.
depth
=
self
.
d
epth
}
}
...
...
@@ -322,7 +322,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
if
self
.
enableShadowDepth
{
MaterialAnimation
.
animationDisabled
{
[
unowned
sideView
=
self
.
sideView
]
in
sideView
.
shadowD
epth
=
.
None
sideView
.
d
epth
=
.
None
}
}
...
...
@@ -399,7 +399,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
toggleStatusBar
(
true
)
if
enableShadowDepth
{
MaterialAnimation
.
animationDisabled
{
[
unowned
self
,
sideView
=
self
.
sideView
]
in
sideView
.
shadowDepth
=
self
.
shadowD
epth
sideView
.
depth
=
self
.
d
epth
}
}
delegate
?
.
sideNavigationViewPanDidBegin
?(
self
,
point
:
sideView
.
position
)
...
...
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