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
0a2a3869
Unverified
Commit
0a2a3869
authored
Apr 04, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: added border color, border width, and updated text inset merge
parent
4309c160
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletions
+33
-1
Sources/iOS/Material+Motion.swift
+2
-0
Sources/iOS/Material+MotionAnimation.swift
+30
-0
Sources/iOS/TextField.swift
+1
-1
No files found.
Sources/iOS/Material+Motion.swift
View file @
0a2a3869
...
@@ -546,6 +546,8 @@ extension MotionAnimator {
...
@@ -546,6 +546,8 @@ extension MotionAnimator {
snapshotAnimations
.
append
(
Motion
.
position
(
to
:
to
.
motionPosition
))
snapshotAnimations
.
append
(
Motion
.
position
(
to
:
to
.
motionPosition
))
snapshotAnimations
.
append
(
Motion
.
transform
(
transform
:
to
.
motionTransform
))
snapshotAnimations
.
append
(
Motion
.
transform
(
transform
:
to
.
motionTransform
))
snapshotAnimations
.
append
(
Motion
.
background
(
color
:
to
.
backgroundColor
??
.
clear
))
snapshotAnimations
.
append
(
Motion
.
background
(
color
:
to
.
backgroundColor
??
.
clear
))
snapshotAnimations
.
append
(
Motion
.
border
(
color
:
to
.
borderColor
??
.
clear
))
snapshotAnimations
.
append
(
Motion
.
border
(
width
:
to
.
borderWidth
))
if
let
path
=
to
.
layer
.
shadowPath
{
if
let
path
=
to
.
layer
.
shadowPath
{
let
shadowPath
=
Motion
.
shadow
(
path
:
path
)
let
shadowPath
=
Motion
.
shadow
(
path
:
path
)
...
...
Sources/iOS/Material+MotionAnimation.swift
View file @
0a2a3869
...
@@ -33,6 +33,8 @@ import UIKit
...
@@ -33,6 +33,8 @@ import UIKit
public
enum
MotionAnimationKeyPath
:
String
{
public
enum
MotionAnimationKeyPath
:
String
{
case
backgroundColor
case
backgroundColor
case
barTintColor
case
barTintColor
case
borderColor
case
borderWidth
case
cornerRadius
case
cornerRadius
case
transform
case
transform
case
rotation
=
"transform.rotation"
case
rotation
=
"transform.rotation"
...
@@ -66,6 +68,8 @@ public enum MotionAnimation {
...
@@ -66,6 +68,8 @@ public enum MotionAnimation {
case
custom
(
CABasicAnimation
)
case
custom
(
CABasicAnimation
)
case
backgroundColor
(
UIColor
)
case
backgroundColor
(
UIColor
)
case
barTintColor
(
UIColor
)
case
barTintColor
(
UIColor
)
case
borderColor
(
UIColor
)
case
borderWidth
(
CGFloat
)
case
cornerRadius
(
CGFloat
)
case
cornerRadius
(
CGFloat
)
case
transform
(
CATransform3D
)
case
transform
(
CATransform3D
)
case
rotationAngle
(
CGFloat
)
case
rotationAngle
(
CGFloat
)
...
@@ -264,6 +268,10 @@ extension CALayer {
...
@@ -264,6 +268,10 @@ extension CALayer {
a
.
append
(
Motion
.
background
(
color
:
color
))
a
.
append
(
Motion
.
background
(
color
:
color
))
case
let
.
barTintColor
(
color
):
case
let
.
barTintColor
(
color
):
a
.
append
(
Motion
.
barTint
(
color
:
color
))
a
.
append
(
Motion
.
barTint
(
color
:
color
))
case
let
.
borderColor
(
color
):
a
.
append
(
Motion
.
border
(
color
:
color
))
case
let
.
borderWidth
(
width
):
a
.
append
(
Motion
.
border
(
width
:
width
))
case
let
.
cornerRadius
(
radius
):
case
let
.
cornerRadius
(
radius
):
a
.
append
(
Motion
.
corner
(
radius
:
radius
))
a
.
append
(
Motion
.
corner
(
radius
:
radius
))
case
let
.
transform
(
transform
):
case
let
.
transform
(
transform
):
...
@@ -478,6 +486,28 @@ extension Motion {
...
@@ -478,6 +486,28 @@ extension Motion {
}
}
/**
/**
Creates a CABasicAnimation for the borderColor key path.
- Parameter color: A UIColor.
- Returns: A CABasicAnimation.
*/
public
static
func
border
(
color
:
UIColor
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
borderColor
)
animation
.
toValue
=
color
.
cgColor
return
animation
}
/**
Creates a CABasicAnimation for the borderWidth key path.
- Parameter width: A CGFloat.
- Returns: A CABasicAnimation.
*/
public
static
func
border
(
width
:
CGFloat
)
->
CABasicAnimation
{
let
animation
=
CABasicAnimation
(
keyPath
:
.
borderWidth
)
animation
.
toValue
=
width
return
animation
}
/**
Creates a CABasicAnimation for the cornerRadius key path.
Creates a CABasicAnimation for the cornerRadius key path.
- Parameter radius: A CGFloat.
- Parameter radius: A CGFloat.
- Returns: A CABasicAnimation.
- Returns: A CABasicAnimation.
...
...
Sources/iOS/TextField.swift
View file @
0a2a3869
...
@@ -387,10 +387,10 @@ open class TextField: UITextField {
...
@@ -387,10 +387,10 @@ open class TextField: UITextField {
return
super
.
becomeFirstResponder
()
return
super
.
becomeFirstResponder
()
}
}
/// EdgeInsets for text.
open
var
textInset
:
CGFloat
=
0
open
var
textInset
:
CGFloat
=
0
open
override
func
textRect
(
forBounds
bounds
:
CGRect
)
->
CGRect
{
open
override
func
textRect
(
forBounds
bounds
:
CGRect
)
->
CGRect
{
return
bounds
.
insetBy
(
dx
:
textInset
,
dy
:
0
)
return
bounds
.
insetBy
(
dx
:
textInset
,
dy
:
0
)
}
}
...
...
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