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
1185c534
Commit
1185c534
authored
Aug 21, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: fixed TextField placeholder animation and updated general code style
parent
8e4bfc89
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
32 deletions
+37
-32
Sources/iOS/Button.swift
+6
-6
Sources/iOS/CollectionReusableView.swift
+1
-1
Sources/iOS/CollectionView.swift
+1
-1
Sources/iOS/CollectionViewCell.swift
+1
-1
Sources/iOS/CollectionViewLayout.swift
+1
-1
Sources/iOS/ControlView.swift
+1
-1
Sources/iOS/Grid.swift
+1
-1
Sources/iOS/Menu.swift
+1
-1
Sources/iOS/TabBar.swift
+13
-18
Sources/iOS/TextField.swift
+11
-1
No files found.
Sources/iOS/Button.swift
View file @
1185c534
...
...
@@ -133,7 +133,7 @@ open class Button: UIButton {
*/
public
convenience
init
(
image
:
UIImage
?)
{
self
.
init
()
prepare
With
(
image
:
image
,
tintColor
:
nil
)
prepare
(
with
:
image
,
tintColor
:
nil
)
}
/**
...
...
@@ -143,7 +143,7 @@ open class Button: UIButton {
*/
public
convenience
init
(
image
:
UIImage
?,
tintColor
:
UIColor
?)
{
self
.
init
()
prepare
With
(
image
:
image
,
tintColor
:
tintColor
)
prepare
(
with
:
image
,
tintColor
:
tintColor
)
}
/**
...
...
@@ -152,7 +152,7 @@ open class Button: UIButton {
*/
public
convenience
init
(
title
:
String
?)
{
self
.
init
()
prepare
With
(
title
:
title
,
titleColor
:
nil
)
prepare
(
with
:
title
,
titleColor
:
nil
)
}
/**
...
...
@@ -162,7 +162,7 @@ open class Button: UIButton {
*/
public
convenience
init
(
title
:
String
?,
titleColor
:
UIColor
?)
{
self
.
init
()
prepare
With
(
title
:
title
,
titleColor
:
titleColor
)
prepare
(
with
:
title
,
titleColor
:
titleColor
)
}
open
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
...
...
@@ -259,7 +259,7 @@ open class Button: UIButton {
- Parameter image: A UIImage.
- Parameter tintColor: A UIColor.
*/
private
func
prepare
With
(
image
:
UIImage
?,
tintColor
:
UIColor
?)
{
private
func
prepare
(
with
image
:
UIImage
?,
tintColor
:
UIColor
?)
{
self
.
image
=
image
self
.
tintColor
=
tintColor
}
...
...
@@ -269,7 +269,7 @@ open class Button: UIButton {
- Parameter title: A String.
- Parameter titleColor: A UIColor.
*/
private
func
prepare
With
(
title
:
String
?,
titleColor
:
UIColor
?)
{
private
func
prepare
(
with
title
:
String
?,
titleColor
:
UIColor
?)
{
self
.
title
=
title
self
.
titleColor
=
titleColor
}
...
...
Sources/iOS/CollectionReusableView.swift
View file @
1185c534
...
...
@@ -147,7 +147,7 @@ open class MaterialCollectionReusableView: UICollectionReusableView {
}
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/CollectionView.swift
View file @
1185c534
...
...
@@ -62,7 +62,7 @@ open class CollectionView: UICollectionView {
}
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/CollectionViewCell.swift
View file @
1185c534
...
...
@@ -155,7 +155,7 @@ open class CollectionViewCell: UICollectionViewCell {
}
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/CollectionViewLayout.swift
View file @
1185c534
...
...
@@ -60,7 +60,7 @@ open class CollectionViewLayout: UICollectionViewLayout {
open
var
scrollDirection
:
UICollectionViewScrollDirection
=
.
vertical
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/ControlView.swift
View file @
1185c534
...
...
@@ -58,7 +58,7 @@ open class ControlView: View {
}
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/Grid.swift
View file @
1185c534
...
...
@@ -159,7 +159,7 @@ public class Grid {
}
/// A preset wrapper for interim space.
public
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
public
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/Menu.swift
View file @
1185c534
...
...
@@ -50,7 +50,7 @@ public class Menu {
}
/// A preset wrapper around interimSpace.
public
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
public
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
Sources/iOS/TabBar.swift
View file @
1185c534
...
...
@@ -41,7 +41,7 @@ open class TabBar: View {
open
internal(set)
var
line
:
UIView
!
/// A value for the line alignment.
open
var
lineAlignment
:
TabBarLineAlignment
=
.
bottom
{
open
var
lineAlignment
=
TabBarLineAlignment
.
bottom
{
didSet
{
layoutSubviews
()
}
...
...
@@ -74,7 +74,7 @@ open class TabBar: View {
}
/// A preset wrapper around interimSpace.
open
var
interimSpacePreset
:
InterimSpacePreset
=
.
none
{
open
var
interimSpacePreset
=
InterimSpacePreset
.
none
{
didSet
{
interimSpace
=
InterimSpacePresetToValue
(
preset
:
interimSpacePreset
)
}
...
...
@@ -96,19 +96,16 @@ open class TabBar: View {
}
/// Buttons.
open
var
buttons
:
[
UIButton
]?
{
open
var
buttons
=
[
UIButton
]()
{
didSet
{
if
let
v
:
[
UIButton
]
=
oldValue
{
for
b
in
v
{
for
b
in
oldValue
{
b
.
removeFromSuperview
()
}
}
if
let
v
:
[
UIButton
]
=
buttons
{
for
b
in
v
{
for
b
in
buttons
{
addSubview
(
b
)
}
}
layoutSubviews
()
}
}
...
...
@@ -116,19 +113,17 @@ open class TabBar: View {
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
willRenderView
{
if
let
v
=
buttons
{
if
0
<
v
.
count
{
let
columns
:
Int
=
grid
.
axis
.
columns
/
v
.
count
for
b
in
v
{
if
0
<
buttons
.
count
{
let
columns
:
Int
=
grid
.
axis
.
columns
/
buttons
.
count
for
b
in
buttons
{
b
.
grid
.
columns
=
columns
b
.
contentEdgeInsets
=
.
zero
b
.
layer
.
cornerRadius
=
0
b
.
removeTarget
(
self
,
action
:
#selector(
handleButton(button:)
)
,
for
:
.
touchUpInside
)
b
.
addTarget
(
self
,
action
:
#selector(
handleButton(button:)
)
,
for
:
.
touchUpInside
)
}
grid
.
views
=
v
as
[
UIView
]
line
.
frame
=
CGRect
(
x
:
0
,
y
:
.
bottom
==
lineAlignment
?
height
-
3
:
0
,
width
:
v
.
first
!.
frame
.
width
,
height
:
3
)
}
grid
.
views
=
buttons
as
[
UIView
]
line
.
frame
=
CGRect
(
x
:
0
,
y
:
.
bottom
==
lineAlignment
?
height
-
3
:
0
,
width
:
buttons
.
first
!.
width
,
height
:
3
)
}
}
}
...
...
@@ -138,8 +133,8 @@ open class TabBar: View {
internal
func
handleButton
(
button
:
UIButton
)
{
UIView
.
animate
(
withDuration
:
0.25
,
animations
:
{
[
weak
self
]
in
if
let
s
=
self
{
s
.
line
.
frame
.
origin
.
x
=
button
.
frame
.
origi
n
.
x
s
.
line
.
frame
.
size
.
width
=
button
.
frame
.
size
.
width
s
.
line
.
x
=
butto
n
.
x
s
.
line
.
width
=
button
.
width
}
})
}
...
...
Sources/iOS/TextField.swift
View file @
1185c534
...
...
@@ -275,6 +275,17 @@ open class TextField: UITextField {
open
private(set)
var
visibilityIconButton
:
IconButton
?
/**
`layoutIfNeeded` is called within `becomeFirstResponder` to
fix an issue that when the TextField calls `becomeFirstResponder`
immediately when launching an instance, the TextField is not
calculated correctly.
*/
open
override
func
becomeFirstResponder
()
->
Bool
{
layoutIfNeeded
()
return
super
.
becomeFirstResponder
()
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
...
...
@@ -314,7 +325,6 @@ open class TextField: UITextField {
/// Handles the text editing did begin state.
open
func
handleEditingDidBegin
()
{
layoutIfNeeded
()
dividerEditingDidBeginAnimation
()
placeholderEditingDidBeginAnimation
()
}
...
...
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