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
f45e8ec6
Unverified
Commit
f45e8ec6
authored
Dec 14, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: cleanup to Pulse API when calling pulse method
parent
0372b3bc
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
25 additions
and
40 deletions
+25
-40
Material.xcodeproj/project.pbxproj
+3
-3
Sources/iOS/Button.swift
+3
-6
Sources/iOS/CollectionReusableView.swift
+3
-6
Sources/iOS/CollectionView.swift
+1
-1
Sources/iOS/CollectionViewCell.swift
+3
-6
Sources/iOS/CollectionViewDelegate.swift
+1
-3
Sources/iOS/Layer.swift
+1
-1
Sources/iOS/PulseView.swift
+3
-6
Sources/iOS/TableViewCell.swift
+3
-6
Sources/iOS/View.swift
+4
-2
No files found.
Material.xcodeproj/project.pbxproj
View file @
f45e8ec6
...
@@ -720,13 +720,13 @@
...
@@ -720,13 +720,13 @@
96BCB8051CB40F9C00C806FE
/* Collection */
=
{
96BCB8051CB40F9C00C806FE
/* Collection */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
96BCB7711CB40DC500C806FE
/* CollectionView.swift */
,
96BCB7721CB40DC500C806FE
/* CollectionViewCell.swift */
,
96BCB7721CB40DC500C806FE
/* CollectionViewCell.swift */
,
966ECF291CF4C20100BB0BDF
/* CollectionReusableView.swift */
,
96BCB7711CB40DC500C806FE
/* CollectionView.swift */
,
96BCB7771CB40DC500C806FE
/* CollectionDataSourceItem.swift */
,
96BCB7731CB40DC500C806FE
/* CollectionViewDataSource.swift */
,
96BCB7731CB40DC500C806FE
/* CollectionViewDataSource.swift */
,
96BCB7741CB40DC500C806FE
/* CollectionViewDelegate.swift */
,
96BCB7741CB40DC500C806FE
/* CollectionViewDelegate.swift */
,
96BCB7751CB40DC500C806FE
/* CollectionViewLayout.swift */
,
96BCB7751CB40DC500C806FE
/* CollectionViewLayout.swift */
,
966ECF291CF4C20100BB0BDF
/* CollectionReusableView.swift */
,
96BCB7771CB40DC500C806FE
/* CollectionDataSourceItem.swift */
,
);
);
name
=
Collection
;
name
=
Collection
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
...
Sources/iOS/Button.swift
View file @
f45e8ec6
...
@@ -40,7 +40,7 @@ open class Button: UIButton, Pulseable {
...
@@ -40,7 +40,7 @@ open class Button: UIButton, Pulseable {
open
let
visualLayer
=
CAShapeLayer
()
open
let
visualLayer
=
CAShapeLayer
()
/// A Pulse reference.
/// A Pulse reference.
open
fileprivate
(
set
)
var
pulse
:
Pulse
!
fileprivate
var
pulse
:
Pulse
!
/// PulseAnimation value.
/// PulseAnimation value.
open
var
pulseAnimation
:
PulseAnimation
{
open
var
pulseAnimation
:
PulseAnimation
{
...
@@ -176,14 +176,11 @@ open class Button: UIButton, Pulseable {
...
@@ -176,14 +176,11 @@ open class Button: UIButton, Pulseable {
from the center.
from the center.
*/
*/
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
let
p
=
nil
==
point
?
CGPoint
(
x
:
CGFloat
(
width
/
2
),
y
:
CGFloat
(
height
/
2
))
:
point
!
let
p
=
point
??
center
pulse
.
expandAnimation
(
point
:
p
)
pulse
.
expandAnimation
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
self
?
.
pulse
.
contractAnimation
()
return
}
s
.
pulse
.
contractAnimation
()
}
}
}
}
...
...
Sources/iOS/CollectionReusableView.swift
View file @
f45e8ec6
...
@@ -41,7 +41,7 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable {
...
@@ -41,7 +41,7 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable {
open
let
visualLayer
=
CAShapeLayer
()
open
let
visualLayer
=
CAShapeLayer
()
/// A Pulse reference.
/// A Pulse reference.
open
fileprivate
(
set
)
var
pulse
:
Pulse
!
fileprivate
var
pulse
:
Pulse
!
/// PulseAnimation value.
/// PulseAnimation value.
open
var
pulseAnimation
:
PulseAnimation
{
open
var
pulseAnimation
:
PulseAnimation
{
...
@@ -237,14 +237,11 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable {
...
@@ -237,14 +237,11 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable {
from the center.
from the center.
*/
*/
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
let
p
=
nil
==
point
?
CGPoint
(
x
:
CGFloat
(
width
/
2
),
y
:
CGFloat
(
height
/
2
))
:
point
!
let
p
=
point
??
center
pulse
.
expandAnimation
(
point
:
p
)
pulse
.
expandAnimation
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
self
?
.
pulse
.
contractAnimation
()
return
}
s
.
pulse
.
contractAnimation
()
}
}
}
}
...
...
Sources/iOS/CollectionView.swift
View file @
f45e8ec6
...
@@ -120,7 +120,7 @@ open class CollectionView: UICollectionView {
...
@@ -120,7 +120,7 @@ open class CollectionView: UICollectionView {
*/
*/
open
func
prepare
()
{
open
func
prepare
()
{
contentScaleFactor
=
Screen
.
scale
contentScaleFactor
=
Screen
.
scale
backgroundColor
=
.
clear
backgroundColor
=
nil
contentEdgeInsets
=
.
zero
contentEdgeInsets
=
.
zero
}
}
}
}
Sources/iOS/CollectionViewCell.swift
View file @
f45e8ec6
...
@@ -41,7 +41,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable {
...
@@ -41,7 +41,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable {
open
let
visualLayer
=
CAShapeLayer
()
open
let
visualLayer
=
CAShapeLayer
()
/// A Pulse reference.
/// A Pulse reference.
open
fileprivate
(
set
)
var
pulse
:
Pulse
!
fileprivate
var
pulse
:
Pulse
!
/// PulseAnimation value.
/// PulseAnimation value.
open
var
pulseAnimation
:
PulseAnimation
{
open
var
pulseAnimation
:
PulseAnimation
{
...
@@ -237,14 +237,11 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable {
...
@@ -237,14 +237,11 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable {
from the center.
from the center.
*/
*/
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
let
p
=
nil
==
point
?
CGPoint
(
x
:
CGFloat
(
width
/
2
),
y
:
CGFloat
(
height
/
2
))
:
point
!
let
p
=
point
??
center
pulse
.
expandAnimation
(
point
:
p
)
pulse
.
expandAnimation
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
self
?
.
pulse
.
contractAnimation
()
return
}
s
.
pulse
.
contractAnimation
()
}
}
}
}
...
...
Sources/iOS/CollectionViewDelegate.swift
View file @
f45e8ec6
...
@@ -30,6 +30,4 @@
...
@@ -30,6 +30,4 @@
import
UIKit
import
UIKit
public
protocol
CollectionViewDelegate
:
UICollectionViewDelegate
{
public
protocol
CollectionViewDelegate
:
UICollectionViewDelegate
{}
}
Sources/iOS/Layer.swift
View file @
f45e8ec6
...
@@ -134,7 +134,7 @@ open class Layer: CAShapeLayer {
...
@@ -134,7 +134,7 @@ open class Layer: CAShapeLayer {
*/
*/
public
override
init
(
layer
:
Any
)
{
public
override
init
(
layer
:
Any
)
{
contentsGravityPreset
=
.
resizeAspectFill
contentsGravityPreset
=
.
resizeAspectFill
super
.
init
(
)
super
.
init
(
layer
:
layer
)
prepareVisualLayer
()
prepareVisualLayer
()
}
}
...
...
Sources/iOS/PulseView.swift
View file @
f45e8ec6
...
@@ -32,7 +32,7 @@ import UIKit
...
@@ -32,7 +32,7 @@ import UIKit
open
class
PulseView
:
View
,
Pulseable
{
open
class
PulseView
:
View
,
Pulseable
{
/// A Pulse reference.
/// A Pulse reference.
open
fileprivate
(
set
)
var
pulse
:
Pulse
!
fileprivate
var
pulse
:
Pulse
!
/// PulseAnimation value.
/// PulseAnimation value.
open
var
pulseAnimation
:
PulseAnimation
{
open
var
pulseAnimation
:
PulseAnimation
{
...
@@ -72,14 +72,11 @@ open class PulseView: View, Pulseable {
...
@@ -72,14 +72,11 @@ open class PulseView: View, Pulseable {
from the center.
from the center.
*/
*/
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
let
p
=
nil
==
point
?
CGPoint
(
x
:
CGFloat
(
width
/
2
),
y
:
CGFloat
(
height
/
2
))
:
point
!
let
p
=
point
??
center
pulse
.
expandAnimation
(
point
:
p
)
pulse
.
expandAnimation
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
self
?
.
pulse
.
contractAnimation
()
return
}
s
.
pulse
.
contractAnimation
()
}
}
}
}
...
...
Sources/iOS/TableViewCell.swift
View file @
f45e8ec6
...
@@ -40,7 +40,7 @@ open class TableViewCell: UITableViewCell, Pulseable {
...
@@ -40,7 +40,7 @@ open class TableViewCell: UITableViewCell, Pulseable {
open
let
visualLayer
=
CAShapeLayer
()
open
let
visualLayer
=
CAShapeLayer
()
/// A Pulse reference.
/// A Pulse reference.
open
fileprivate
(
set
)
var
pulse
:
Pulse
!
fileprivate
var
pulse
:
Pulse
!
/// PulseAnimation value.
/// PulseAnimation value.
open
var
pulseAnimation
:
PulseAnimation
{
open
var
pulseAnimation
:
PulseAnimation
{
...
@@ -114,14 +114,11 @@ open class TableViewCell: UITableViewCell, Pulseable {
...
@@ -114,14 +114,11 @@ open class TableViewCell: UITableViewCell, Pulseable {
from the center.
from the center.
*/
*/
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
open
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
let
p
=
nil
==
point
?
CGPoint
(
x
:
CGFloat
(
width
/
2
),
y
:
CGFloat
(
height
/
2
))
:
point
!
let
p
=
point
??
center
pulse
.
expandAnimation
(
point
:
p
)
pulse
.
expandAnimation
(
point
:
p
)
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
Motion
.
delay
(
time
:
0.35
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
self
?
.
pulse
.
contractAnimation
()
return
}
s
.
pulse
.
contractAnimation
()
}
}
}
}
...
...
Sources/iOS/View.swift
View file @
f45e8ec6
...
@@ -105,7 +105,7 @@ open class View: UIView {
...
@@ -105,7 +105,7 @@ open class View: UIView {
/// A Preset for the contentsGravity property.
/// A Preset for the contentsGravity property.
@IBInspectable
@IBInspectable
open
var
contentsGravityPreset
=
Gravity
.
resize
{
open
var
contentsGravityPreset
:
Gravity
{
didSet
{
didSet
{
contentsGravity
=
GravityToValue
(
gravity
:
contentsGravityPreset
)
contentsGravity
=
GravityToValue
(
gravity
:
contentsGravityPreset
)
}
}
...
@@ -135,6 +135,7 @@ open class View: UIView {
...
@@ -135,6 +135,7 @@ open class View: UIView {
- Parameter aDecoder: A NSCoder instance.
- Parameter aDecoder: A NSCoder instance.
*/
*/
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
public
required
init
?(
coder
aDecoder
:
NSCoder
)
{
contentsGravityPreset
=
.
resizeAspectFill
super
.
init
(
coder
:
aDecoder
)
super
.
init
(
coder
:
aDecoder
)
prepare
()
prepare
()
}
}
...
@@ -146,7 +147,8 @@ open class View: UIView {
...
@@ -146,7 +147,8 @@ open class View: UIView {
- Parameter frame: A CGRect instance.
- Parameter frame: A CGRect instance.
*/
*/
public
override
init
(
frame
:
CGRect
)
{
public
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
contentsGravityPreset
=
.
resizeAspectFill
super
.
init
(
frame
:
frame
)
prepare
()
prepare
()
}
}
...
...
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