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
174bfbcd
Commit
174bfbcd
authored
Sep 28, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experimental: added pulseColorOpacity
parent
558cd403
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
17 deletions
+22
-17
Source/FabButton.swift
+1
-0
Source/FlatButton.swift
+1
-0
Source/MaterialButton.swift
+10
-5
Source/MaterialPulseView.swift
+3
-10
Source/MaterialTheme.swift
+4
-0
Source/MaterialView.swift
+2
-2
Source/RaisedButton.swift
+1
-0
No files found.
Source/FabButton.swift
View file @
174bfbcd
...
...
@@ -29,6 +29,7 @@ public class FabButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
fab
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
fab
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
fab
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
fab
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
fab
.
shadowDepth
...
...
Source/FlatButton.swift
View file @
174bfbcd
...
...
@@ -29,6 +29,7 @@ public class FlatButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
flat
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
flat
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
flat
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
flat
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
flat
.
shadowDepth
...
...
Source/MaterialButton.swift
View file @
174bfbcd
...
...
@@ -29,12 +29,17 @@ public class MaterialButton : UIButton {
//
internal
lazy
var
pulseLayer
:
CAShapeLayer
=
CAShapeLayer
()
//
// :name: pulseColorOpacity
//
internal
var
pulseColorOpacity
:
CGFloat
!
/**
:name: pulseColor
*/
public
var
pulseColor
:
UIColor
?
{
didSet
{
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
0.5
)
.
CGColor
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
pulseColorOpacity
!
)
.
CGColor
}
}
...
...
@@ -260,8 +265,6 @@ public class MaterialButton : UIButton {
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
visualLayer
.
frame
=
bounds
visualLayer
.
zPosition
=
-
1
pulseLayer
.
zPosition
=
1000
}
/**
...
...
@@ -311,11 +314,13 @@ public class MaterialButton : UIButton {
//
internal
func
prepareView
()
{
// visualLayer
layer
.
insertSublayer
(
visualLayer
,
atIndex
:
0
)
layer
.
addSublayer
(
visualLayer
)
visualLayer
.
zPosition
=
-
1
// pulseLayer
pulseLayer
.
hidden
=
true
visualLayer
.
insertSublayer
(
pulseLayer
,
atIndex
:
1000
)
visualLayer
.
addSublayer
(
pulseLayer
)
pulseLayer
.
zPosition
=
1000
}
//
...
...
Source/MaterialPulseView.swift
View file @
174bfbcd
...
...
@@ -29,7 +29,7 @@ public class MaterialPulseView: MaterialView {
*/
public
var
pulseColor
:
UIColor
?
{
didSet
{
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
0.5
)
.
CGColor
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
MaterialTheme
.
pulseView
.
pulseColorOpacity
)
.
CGColor
}
}
...
...
@@ -41,14 +41,6 @@ public class MaterialPulseView: MaterialView {
}
/**
:name: layoutSubviews
*/
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
pulseLayer
.
zPosition
=
1000
}
/**
:name: touchesBegan
*/
public
override
func
touchesBegan
(
touches
:
Set
<
UITouch
>
,
withEvent
event
:
UIEvent
?)
{
...
...
@@ -113,7 +105,8 @@ public class MaterialPulseView: MaterialView {
// pulseLayer
pulseLayer
.
hidden
=
true
visualLayer
.
insertSublayer
(
pulseLayer
,
atIndex
:
1000
)
visualLayer
.
addSublayer
(
pulseLayer
)
pulseLayer
.
zPosition
=
1000
}
//
...
...
Source/MaterialTheme.swift
View file @
174bfbcd
...
...
@@ -88,6 +88,7 @@ public extension MaterialTheme.pulseView {
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
0.5
// interaction
public
static
let
userInteractionEnabled
:
Bool
=
MaterialTheme
.
view
.
userInteractionEnabled
...
...
@@ -158,6 +159,7 @@ public extension MaterialTheme.button.flat {
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
blue
.
accent3
// interaction
...
...
@@ -189,6 +191,7 @@ public extension MaterialTheme.button.raised {
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
// interaction
...
...
@@ -221,6 +224,7 @@ public extension MaterialTheme.button.fab {
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
red
.
darken1
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
// interaction
...
...
Source/MaterialView.swift
View file @
174bfbcd
...
...
@@ -282,7 +282,6 @@ public class MaterialView: UIView {
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
visualLayer
.
frame
=
bounds
visualLayer
.
zPosition
=
-
1
}
//
...
...
@@ -305,7 +304,8 @@ public class MaterialView: UIView {
borderColor
=
MaterialTheme
.
view
.
bordercolor
// visualLayer
layer
.
insertSublayer
(
visualLayer
,
atIndex
:
0
)
layer
.
addSublayer
(
visualLayer
)
visualLayer
.
zPosition
=
-
1
}
//
...
...
Source/RaisedButton.swift
View file @
174bfbcd
...
...
@@ -29,6 +29,7 @@ public class RaisedButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
raised
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
raised
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
raised
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
raised
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
raised
.
shadowDepth
...
...
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