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 {
...
@@ -29,6 +29,7 @@ public class FabButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
fab
.
userInteractionEnabled
userInteractionEnabled
=
MaterialTheme
.
button
.
fab
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
fab
.
backgroudColor
backgroundColor
=
MaterialTheme
.
button
.
fab
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
fab
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
fab
.
pulseColor
pulseColor
=
MaterialTheme
.
button
.
fab
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
fab
.
shadowDepth
shadowDepth
=
MaterialTheme
.
button
.
fab
.
shadowDepth
...
...
Source/FlatButton.swift
View file @
174bfbcd
...
@@ -29,6 +29,7 @@ public class FlatButton : MaterialButton {
...
@@ -29,6 +29,7 @@ public class FlatButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
flat
.
userInteractionEnabled
userInteractionEnabled
=
MaterialTheme
.
button
.
flat
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
flat
.
backgroudColor
backgroundColor
=
MaterialTheme
.
button
.
flat
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
flat
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
flat
.
pulseColor
pulseColor
=
MaterialTheme
.
button
.
flat
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
flat
.
shadowDepth
shadowDepth
=
MaterialTheme
.
button
.
flat
.
shadowDepth
...
...
Source/MaterialButton.swift
View file @
174bfbcd
...
@@ -29,12 +29,17 @@ public class MaterialButton : UIButton {
...
@@ -29,12 +29,17 @@ public class MaterialButton : UIButton {
//
//
internal
lazy
var
pulseLayer
:
CAShapeLayer
=
CAShapeLayer
()
internal
lazy
var
pulseLayer
:
CAShapeLayer
=
CAShapeLayer
()
//
// :name: pulseColorOpacity
//
internal
var
pulseColorOpacity
:
CGFloat
!
/**
/**
:name: pulseColor
:name: pulseColor
*/
*/
public
var
pulseColor
:
UIColor
?
{
public
var
pulseColor
:
UIColor
?
{
didSet
{
didSet
{
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
0.5
)
.
CGColor
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
pulseColorOpacity
!
)
.
CGColor
}
}
}
}
...
@@ -260,8 +265,6 @@ public class MaterialButton : UIButton {
...
@@ -260,8 +265,6 @@ public class MaterialButton : UIButton {
public
override
func
layoutSubviews
()
{
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
visualLayer
.
frame
=
bounds
visualLayer
.
frame
=
bounds
visualLayer
.
zPosition
=
-
1
pulseLayer
.
zPosition
=
1000
}
}
/**
/**
...
@@ -311,11 +314,13 @@ public class MaterialButton : UIButton {
...
@@ -311,11 +314,13 @@ public class MaterialButton : UIButton {
//
//
internal
func
prepareView
()
{
internal
func
prepareView
()
{
// visualLayer
// visualLayer
layer
.
insertSublayer
(
visualLayer
,
atIndex
:
0
)
layer
.
addSublayer
(
visualLayer
)
visualLayer
.
zPosition
=
-
1
// pulseLayer
// pulseLayer
pulseLayer
.
hidden
=
true
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 {
...
@@ -29,7 +29,7 @@ public class MaterialPulseView: MaterialView {
*/
*/
public
var
pulseColor
:
UIColor
?
{
public
var
pulseColor
:
UIColor
?
{
didSet
{
didSet
{
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
0.5
)
.
CGColor
pulseLayer
.
backgroundColor
=
pulseColor
?
.
colorWithAlphaComponent
(
MaterialTheme
.
pulseView
.
pulseColorOpacity
)
.
CGColor
}
}
}
}
...
@@ -41,14 +41,6 @@ public class MaterialPulseView: MaterialView {
...
@@ -41,14 +41,6 @@ public class MaterialPulseView: MaterialView {
}
}
/**
/**
:name: layoutSubviews
*/
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
pulseLayer
.
zPosition
=
1000
}
/**
:name: touchesBegan
:name: touchesBegan
*/
*/
public
override
func
touchesBegan
(
touches
:
Set
<
UITouch
>
,
withEvent
event
:
UIEvent
?)
{
public
override
func
touchesBegan
(
touches
:
Set
<
UITouch
>
,
withEvent
event
:
UIEvent
?)
{
...
@@ -113,7 +105,8 @@ public class MaterialPulseView: MaterialView {
...
@@ -113,7 +105,8 @@ public class MaterialPulseView: MaterialView {
// pulseLayer
// pulseLayer
pulseLayer
.
hidden
=
true
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 {
...
@@ -88,6 +88,7 @@ public extension MaterialTheme.pulseView {
// color
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
0.5
// interaction
// interaction
public
static
let
userInteractionEnabled
:
Bool
=
MaterialTheme
.
view
.
userInteractionEnabled
public
static
let
userInteractionEnabled
:
Bool
=
MaterialTheme
.
view
.
userInteractionEnabled
...
@@ -158,6 +159,7 @@ public extension MaterialTheme.button.flat {
...
@@ -158,6 +159,7 @@ public extension MaterialTheme.button.flat {
// color
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
blue
.
accent3
// interaction
// interaction
...
@@ -189,6 +191,7 @@ public extension MaterialTheme.button.raised {
...
@@ -189,6 +191,7 @@ public extension MaterialTheme.button.raised {
// color
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
// interaction
// interaction
...
@@ -221,6 +224,7 @@ public extension MaterialTheme.button.fab {
...
@@ -221,6 +224,7 @@ public extension MaterialTheme.button.fab {
// color
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
red
.
darken1
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
red
.
darken1
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColor
:
UIColor
=
MaterialColor
.
white
public
static
let
pulseColorOpacity
:
CGFloat
=
MaterialTheme
.
pulseView
.
pulseColorOpacity
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
public
static
let
titleLabelColorForNormalState
:
UIColor
=
MaterialColor
.
white
// interaction
// interaction
...
...
Source/MaterialView.swift
View file @
174bfbcd
...
@@ -282,7 +282,6 @@ public class MaterialView: UIView {
...
@@ -282,7 +282,6 @@ public class MaterialView: UIView {
public
override
func
layoutSubviews
()
{
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
visualLayer
.
frame
=
bounds
visualLayer
.
frame
=
bounds
visualLayer
.
zPosition
=
-
1
}
}
//
//
...
@@ -305,7 +304,8 @@ public class MaterialView: UIView {
...
@@ -305,7 +304,8 @@ public class MaterialView: UIView {
borderColor
=
MaterialTheme
.
view
.
bordercolor
borderColor
=
MaterialTheme
.
view
.
bordercolor
// visualLayer
// 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 {
...
@@ -29,6 +29,7 @@ public class RaisedButton : MaterialButton {
userInteractionEnabled
=
MaterialTheme
.
button
.
raised
.
userInteractionEnabled
userInteractionEnabled
=
MaterialTheme
.
button
.
raised
.
userInteractionEnabled
backgroundColor
=
MaterialTheme
.
button
.
raised
.
backgroudColor
backgroundColor
=
MaterialTheme
.
button
.
raised
.
backgroudColor
pulseColorOpacity
=
MaterialTheme
.
button
.
raised
.
pulseColorOpacity
pulseColor
=
MaterialTheme
.
button
.
raised
.
pulseColor
pulseColor
=
MaterialTheme
.
button
.
raised
.
pulseColor
shadowDepth
=
MaterialTheme
.
button
.
raised
.
shadowDepth
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