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
156f4984
Commit
156f4984
authored
Aug 27, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progressive cleanup
parent
605728de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
Source/FlatButton.swift
+3
-2
Source/RaisedButton.swift
+12
-8
No files found.
Source/FlatButton.swift
View file @
156f4984
...
@@ -49,13 +49,14 @@ public class FlatButton : MaterialButton {
...
@@ -49,13 +49,14 @@ public class FlatButton : MaterialButton {
let
touchLocation
=
touch
.
locationInView
(
self
)
let
touchLocation
=
touch
.
locationInView
(
self
)
pulseView
=
UIView
()
pulseView
=
UIView
()
pulseView
!.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
height
,
self
.
bounds
.
size
.
height
)
pulseView
!.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
height
,
self
.
bounds
.
size
.
height
)
pulseView
!.
layer
.
cornerRadius
=
bounds
.
height
/
2
pulseView
!.
layer
.
cornerRadius
=
bounds
.
height
/
2
.0
pulseView
!.
center
=
touchLocation
pulseView
!.
center
=
touchLocation
pulseView
!.
backgroundColor
=
pulseColor
!.
colorWithAlphaComponent
(
0.5
)
pulseView
!.
backgroundColor
=
pulseColor
!.
colorWithAlphaComponent
(
0.5
)
backgroundColorView
.
addSubview
(
pulseView
!
)
backgroundColorView
.
addSubview
(
pulseView
!
)
textColor
=
self
.
titleLabel
?
.
textColor
UIView
.
animateWithDuration
(
0.3
,
animations
:
{
UIView
.
animateWithDuration
(
0.3
,
animations
:
{
self
.
pulseView
!.
transform
=
CGAffineTransformMakeScale
(
10
,
10
)
self
.
pulseView
!.
transform
=
CGAffineTransformMakeScale
(
10
,
10
)
self
.
transform
=
CGAffineTransformMakeScale
(
15
,
1.1
)
self
.
transform
=
CGAffineTransformMakeScale
(
1
.0
5
,
1.1
)
self
.
setTitleColor
(
UIColor
.
whiteColor
(),
forState
:
.
Normal
)
self
.
setTitleColor
(
UIColor
.
whiteColor
(),
forState
:
.
Normal
)
})
})
}
}
...
...
Source/RaisedButton.swift
View file @
156f4984
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
import
UIKit
import
UIKit
public
class
RaisedButton
:
MaterialButton
{
public
class
RaisedButton
:
MaterialButton
{
/**
:name: textColor
*/
public
var
textColor
:
UIColor
?
//
//
// :name: prepareButton
// :name: prepareButton
//
//
...
@@ -45,17 +50,16 @@ public class RaisedButton : MaterialButton {
...
@@ -45,17 +50,16 @@ public class RaisedButton : MaterialButton {
let
touchLocation
=
touch
.
locationInView
(
self
)
let
touchLocation
=
touch
.
locationInView
(
self
)
pulseView
=
UIView
()
pulseView
=
UIView
()
pulseView
!.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
height
,
self
.
bounds
.
size
.
height
)
pulseView
!.
frame
=
CGRectMake
(
0
,
0
,
self
.
bounds
.
size
.
height
,
self
.
bounds
.
size
.
height
)
pulseView
!.
layer
.
cornerRadius
=
bounds
.
height
/
2
pulseView
!.
layer
.
cornerRadius
=
bounds
.
height
/
2
.0
pulseView
!.
center
=
touchLocation
pulseView
!.
center
=
touchLocation
pulseView
!.
backgroundColor
=
pulseColor
!.
colorWithAlphaComponent
(
0.5
)
pulseView
!.
backgroundColor
=
pulseColor
!.
colorWithAlphaComponent
(
0.5
)
backgroundColorView
.
addSubview
(
pulseView
!
)
backgroundColorView
.
addSubview
(
pulseView
!
)
UIView
.
animateWithDuration
(
0.3
,
textColor
=
self
.
titleLabel
?
.
textColor
animations
:
{
UIView
.
animateWithDuration
(
0.3
,
animations
:
{
self
.
pulseView
!.
transform
=
CGAffineTransformMakeScale
(
10
,
10
)
self
.
pulseView
!.
transform
=
CGAffineTransformMakeScale
(
10
,
10
)
self
.
transform
=
CGAffineTransformMakeScale
(
15
,
1.1
)
self
.
transform
=
CGAffineTransformMakeScale
(
1.05
,
1.1
)
},
self
.
setTitleColor
(
UIColor
.
whiteColor
(),
forState
:
.
Normal
)
completion
:
nil
})
)
}
}
}
}
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