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
2e262c5a
Unverified
Commit
2e262c5a
authored
Apr 06, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "development: updated Pulse internal API"
This reverts commit
777f4942
.
parent
777f4942
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
57 additions
and
93 deletions
+57
-93
Sources/iOS/Bar.swift
+4
-8
Sources/iOS/Button.swift
+2
-2
Sources/iOS/Card.swift
+6
-12
Sources/iOS/CollectionReusableView.swift
+2
-2
Sources/iOS/CollectionViewCell.swift
+2
-2
Sources/iOS/ErrorTextField.swift
+1
-2
Sources/iOS/FABMenu.swift
+2
-4
Sources/iOS/ImageCard.swift
+4
-8
Sources/iOS/NavigationBar.swift
+3
-6
Sources/iOS/NavigationItem.swift
+4
-8
Sources/iOS/PresenterCard.swift
+2
-4
Sources/iOS/PulseAnimation.swift
+11
-11
Sources/iOS/PulseView.swift
+2
-2
Sources/iOS/Snackbar.swift
+1
-2
Sources/iOS/TabBar.swift
+2
-4
Sources/iOS/TableViewCell.swift
+2
-2
Sources/iOS/TextField.swift
+5
-10
Sources/iOS/Toolbar.swift
+2
-4
No files found.
Sources/iOS/Bar.swift
View file @
2e262c5a
...
...
@@ -49,8 +49,7 @@ open class Bar: View {
/// Should center the contentView.
open
var
contentViewAlignment
=
ContentViewAlignment
.
full
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -101,8 +100,7 @@ open class Bar: View {
open
var
gridFactor
:
CGFloat
=
12
{
didSet
{
assert
(
0
<
gridFactor
,
"[Material Error: gridFactor must be greater than 0.]"
)
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -115,8 +113,7 @@ open class Bar: View {
for
v
in
oldValue
{
v
.
removeFromSuperview
()
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -126,8 +123,7 @@ open class Bar: View {
for
v
in
oldValue
{
v
.
removeFromSuperview
()
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/Button.swift
View file @
2e262c5a
...
...
@@ -44,7 +44,7 @@ open class Button: UIButton, Pulseable, PulseableLayer {
/// A reference to the pulse layer.
internal
var
pulseLayer
:
CALayer
?
{
return
pulse
.
l
ayer
return
pulse
.
pulseL
ayer
}
/// PulseAnimation value.
...
...
@@ -263,7 +263,7 @@ extension Button {
/// Prepares the pulse motion.
fileprivate
func
preparePulse
()
{
pulse
=
Pulse
(
view
:
self
,
l
ayer
:
visualLayer
)
pulse
=
Pulse
(
pulseView
:
self
,
pulseL
ayer
:
visualLayer
)
}
/**
...
...
Sources/iOS/Card.swift
View file @
2e262c5a
...
...
@@ -69,8 +69,7 @@ open class Card: PulseView {
if
let
v
=
toolbar
{
container
.
addSubview
(
v
)
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -85,8 +84,7 @@ open class Card: PulseView {
@IBInspectable
open
var
toolbarEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -99,8 +97,7 @@ open class Card: PulseView {
v
.
clipsToBounds
=
true
container
.
addSubview
(
v
)
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -115,8 +112,7 @@ open class Card: PulseView {
@IBInspectable
open
var
contentViewEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -128,8 +124,7 @@ open class Card: PulseView {
if
let
v
=
bottomBar
{
container
.
addSubview
(
v
)
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -144,8 +139,7 @@ open class Card: PulseView {
@IBInspectable
open
var
bottomBarEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/CollectionReusableView.swift
View file @
2e262c5a
...
...
@@ -45,7 +45,7 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable, Pulseabl
/// A reference to the pulse layer.
internal
var
pulseLayer
:
CALayer
?
{
return
pulse
.
l
ayer
return
pulse
.
pulseL
ayer
}
/// PulseAnimation value.
...
...
@@ -301,7 +301,7 @@ open class CollectionReusableView: UICollectionReusableView, Pulseable, Pulseabl
extension
CollectionReusableView
{
/// Prepares the pulse motion.
fileprivate
func
preparePulse
()
{
pulse
=
Pulse
(
view
:
self
,
l
ayer
:
visualLayer
)
pulse
=
Pulse
(
pulseView
:
self
,
pulseL
ayer
:
visualLayer
)
pulseAnimation
=
.
none
}
...
...
Sources/iOS/CollectionViewCell.swift
View file @
2e262c5a
...
...
@@ -45,7 +45,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable, PulseableLayer {
/// A reference to the pulse layer.
internal
var
pulseLayer
:
CALayer
?
{
return
pulse
.
l
ayer
return
pulse
.
pulseL
ayer
}
/// PulseAnimation value.
...
...
@@ -259,7 +259,7 @@ open class CollectionViewCell: UICollectionViewCell, Pulseable, PulseableLayer {
extension
CollectionViewCell
{
/// Prepares the pulse motion.
fileprivate
func
preparePulse
()
{
pulse
=
Pulse
(
view
:
self
,
l
ayer
:
visualLayer
)
pulse
=
Pulse
(
pulseView
:
self
,
pulseL
ayer
:
visualLayer
)
}
/// Prepares the visualLayer property.
...
...
Sources/iOS/ErrorTextField.swift
View file @
2e262c5a
...
...
@@ -36,8 +36,7 @@ open class ErrorTextField: TextField {
open
var
isErrorRevealed
=
false
{
didSet
{
detailLabel
.
isHidden
=
!
isErrorRevealed
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/FABMenu.swift
View file @
2e262c5a
...
...
@@ -67,8 +67,7 @@ open class FABMenuItem: View {
}
set
(
value
)
{
titleLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -201,8 +200,7 @@ open class FABMenu: View {
spring
.
springDirection
=
.
right
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/ImageCard.swift
View file @
2e262c5a
...
...
@@ -44,8 +44,7 @@ open class ImageCard: Card {
*/
open
var
imageViewDisplay
=
Display
.
partial
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -60,8 +59,7 @@ open class ImageCard: Card {
@IBInspectable
open
var
imageViewEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -73,16 +71,14 @@ open class ImageCard: Card {
if
let
v
=
imageView
{
container
.
addSubview
(
v
)
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
/// An ImageCardToolbarAlignment value.
open
var
toolbarAlignment
=
ToolbarAlignment
.
bottom
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/NavigationBar.swift
View file @
2e262c5a
...
...
@@ -51,8 +51,7 @@ open class NavigationBar: UINavigationBar {
@IBInspectable
open
var
contentEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -67,8 +66,7 @@ open class NavigationBar: UINavigationBar {
@IBInspectable
open
var
interimSpace
:
InterimSpace
=
0
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -77,8 +75,7 @@ open class NavigationBar: UINavigationBar {
open
var
gridFactor
:
CGFloat
=
12
{
didSet
{
assert
(
0
<
gridFactor
,
"[Material Error: gridFactor must be greater than 0.]"
)
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/NavigationItem.swift
View file @
2e262c5a
...
...
@@ -38,8 +38,7 @@ public class NavigationItem: NSObject {
/// Should center the contentView.
open
var
contentViewAlignment
=
ContentViewAlignment
.
center
{
didSet
{
navigationBar
?
.
setNeedsLayout
()
navigationBar
?
.
layoutIfNeeded
()
navigationBar
?
.
layoutSubviews
()
}
}
...
...
@@ -61,8 +60,7 @@ public class NavigationItem: NSObject {
for
v
in
oldValue
{
v
.
removeFromSuperview
()
}
navigationBar
?
.
setNeedsLayout
()
navigationBar
?
.
layoutIfNeeded
()
navigationBar
?
.
layoutSubviews
()
}
}
...
...
@@ -72,8 +70,7 @@ public class NavigationItem: NSObject {
for
v
in
oldValue
{
v
.
removeFromSuperview
()
}
navigationBar
?
.
setNeedsLayout
()
navigationBar
?
.
layoutIfNeeded
()
navigationBar
?
.
layoutSubviews
()
}
}
...
...
@@ -112,8 +109,7 @@ public class NavigationItem: NSObject {
/// Reloads the subviews for the NavigationBar.
internal
func
reload
()
{
navigationBar
?
.
setNeedsLayout
()
navigationBar
?
.
layoutIfNeeded
()
navigationBar
?
.
layoutSubviews
()
}
/// Prepares the titleLabel.
...
...
Sources/iOS/PresenterCard.swift
View file @
2e262c5a
...
...
@@ -42,8 +42,7 @@ open class PresenterCard: Card {
@IBInspectable
open
var
presenterViewEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -56,8 +55,7 @@ open class PresenterCard: Card {
v
.
clipsToBounds
=
true
container
.
addSubview
(
v
)
}
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/PulseAnimation.swift
View file @
2e262c5a
...
...
@@ -60,10 +60,10 @@ internal protocol PulseableLayer {
public
struct
Pulse
{
/// A UIView that is Pulseable.
fileprivate
weak
var
v
iew
:
UIView
?
fileprivate
weak
var
pulseV
iew
:
UIView
?
/// The layer the pulse layers are added to.
internal
weak
var
l
ayer
:
CALayer
?
internal
weak
var
pulseL
ayer
:
CALayer
?
/// Pulse layers.
fileprivate
var
layers
=
[
CAShapeLayer
]()
...
...
@@ -79,12 +79,12 @@ public struct Pulse {
/**
An initializer that takes a given view and pulse layer.
- Parameter
v
iew: An optional UIView.
- Parameter
l
ayer: An optional CALayer.
- Parameter
pulseV
iew: An optional UIView.
- Parameter
pulseL
ayer: An optional CALayer.
*/
internal
init
(
view
:
UIView
?,
l
ayer
:
CALayer
?)
{
self
.
view
=
v
iew
self
.
layer
=
l
ayer
internal
init
(
pulseView
:
UIView
?,
pulseL
ayer
:
CALayer
?)
{
self
.
pulseView
=
pulseV
iew
self
.
pulseLayer
=
pulseL
ayer
}
/**
...
...
@@ -92,11 +92,11 @@ public struct Pulse {
- Parameter point: A point to pulse from.
*/
public
mutating
func
expand
(
point
:
CGPoint
)
{
guard
let
v
=
v
iew
else
{
guard
let
v
iew
=
pulseV
iew
else
{
return
}
guard
let
layer
=
l
ayer
else
{
guard
let
layer
=
pulseL
ayer
else
{
return
}
...
...
@@ -116,8 +116,8 @@ public struct Pulse {
layer
.
masksToBounds
=
!
(
.
centerRadialBeyondBounds
==
animation
||
.
radialBeyondBounds
==
animation
)
let
w
=
v
.
bounds
.
width
let
h
=
v
.
bounds
.
height
let
w
=
v
iew
.
bounds
.
width
let
h
=
v
iew
.
bounds
.
height
Motion
.
disable
({
[
n
=
.
center
==
animation
?
w
<
h
?
w
:
h
:
w
<
h
?
h
:
w
,
...
...
Sources/iOS/PulseView.swift
View file @
2e262c5a
...
...
@@ -36,7 +36,7 @@ open class PulseView: View, Pulseable, PulseableLayer {
/// A reference to the pulse layer.
internal
var
pulseLayer
:
CALayer
?
{
return
pulse
.
l
ayer
return
pulse
.
pulseL
ayer
}
/// PulseAnimation value.
...
...
@@ -132,6 +132,6 @@ open class PulseView: View, Pulseable, PulseableLayer {
extension
PulseView
{
/// Prepares the pulse motion.
fileprivate
func
preparePulse
()
{
pulse
=
Pulse
(
view
:
self
,
l
ayer
:
visualLayer
)
pulse
=
Pulse
(
pulseView
:
self
,
pulseL
ayer
:
visualLayer
)
}
}
Sources/iOS/Snackbar.swift
View file @
2e262c5a
...
...
@@ -44,8 +44,7 @@ open class Snackbar: Bar {
}
set
(
value
)
{
textLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/TabBar.swift
View file @
2e262c5a
...
...
@@ -118,8 +118,7 @@ open class TabBar: Bar {
centerViews
=
buttons
as
[
UIView
]
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -153,8 +152,7 @@ open class TabBar: Bar {
/// A value for the line alignment.
open
var
lineAlignment
=
TabBarLineAlignment
.
bottom
{
didSet
{
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/TableViewCell.swift
View file @
2e262c5a
...
...
@@ -44,7 +44,7 @@ open class TableViewCell: UITableViewCell, Pulseable, PulseableLayer {
/// A reference to the pulse layer.
internal
var
pulseLayer
:
CALayer
?
{
return
pulse
.
l
ayer
return
pulse
.
pulseL
ayer
}
/// PulseAnimation value.
...
...
@@ -180,7 +180,7 @@ open class TableViewCell: UITableViewCell, Pulseable, PulseableLayer {
extension
TableViewCell
{
/// Prepares the pulse motion.
fileprivate
func
preparePulse
()
{
pulse
=
Pulse
(
view
:
self
,
l
ayer
:
visualLayer
)
pulse
=
Pulse
(
pulseView
:
self
,
pulseL
ayer
:
visualLayer
)
}
/// Prepares the visualLayer property.
...
...
Sources/iOS/TextField.swift
View file @
2e262c5a
...
...
@@ -88,8 +88,7 @@ open class TextField: UITextField {
open
override
var
leftView
:
UIView
?
{
didSet
{
prepareLeftView
()
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -186,8 +185,7 @@ open class TextField: UITextField {
}
set
(
value
)
{
placeholderLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -227,8 +225,7 @@ open class TextField: UITextField {
}
set
(
value
)
{
detailLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -288,8 +285,7 @@ open class TextField: UITextField {
rightView
=
clearIconButton
isClearIconButtonAutoHandled
=
isClearIconButtonAutoHandled
?
true
:
false
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -336,8 +332,7 @@ open class TextField: UITextField {
rightView
=
visibilityIconButton
isVisibilityIconButtonAutoHandled
=
isVisibilityIconButtonAutoHandled
?
true
:
false
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
Sources/iOS/Toolbar.swift
View file @
2e262c5a
...
...
@@ -41,8 +41,7 @@ open class Toolbar: Bar {
}
set
(
value
)
{
titleLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
@@ -58,8 +57,7 @@ open class Toolbar: Bar {
}
set
(
value
)
{
detailLabel
.
text
=
value
setNeedsLayout
()
layoutIfNeeded
()
layoutSubviews
()
}
}
...
...
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