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
e4c4ea9a
Commit
e4c4ea9a
authored
Oct 11, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating spacing for Cards and Navbar
parent
0daf8760
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
22 deletions
+16
-22
Source/BasicCardView.swift
+6
-6
Source/ImageCardView.swift
+6
-6
Source/MaterialTextLayer.swift
+0
-6
Source/MaterialTheme.swift
+2
-2
Source/NavigationBarView.swift
+2
-2
No files found.
Source/BasicCardView.swift
View file @
e4c4ea9a
...
@@ -331,7 +331,7 @@ public class BasicCardView : MaterialPulseView {
...
@@ -331,7 +331,7 @@ public class BasicCardView : MaterialPulseView {
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
}
}
}
}
...
@@ -340,7 +340,7 @@ public class BasicCardView : MaterialPulseView {
...
@@ -340,7 +340,7 @@ public class BasicCardView : MaterialPulseView {
if
0
<
v
.
count
{
if
0
<
v
.
count
{
var
h
:
String
=
"H:"
var
h
:
String
=
"H:"
var
d
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
var
d
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
var
i
:
Int
=
0
var
i
:
Int
=
v
.
count
-
1
for
b
in
v
{
for
b
in
v
{
let
k
:
String
=
"b
\(
i
)
"
let
k
:
String
=
"b
\(
i
)
"
...
@@ -349,17 +349,17 @@ public class BasicCardView : MaterialPulseView {
...
@@ -349,17 +349,17 @@ public class BasicCardView : MaterialPulseView {
h
+=
"[
\(
k
)
]"
h
+=
"[
\(
k
)
]"
if
0
==
i
++
{
if
0
==
i
--
{
h
+=
"-(right_left)-"
}
else
{
h
+=
"-(right)-"
h
+=
"-(right)-"
}
else
{
h
+=
"-(right_left)-"
}
}
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
}
}
}
}
...
...
Source/ImageCardView.swift
View file @
e4c4ea9a
...
@@ -423,7 +423,7 @@ public class ImageCardView : MaterialPulseView {
...
@@ -423,7 +423,7 @@ public class ImageCardView : MaterialPulseView {
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
}
}
}
}
...
@@ -432,7 +432,7 @@ public class ImageCardView : MaterialPulseView {
...
@@ -432,7 +432,7 @@ public class ImageCardView : MaterialPulseView {
if
0
<
v
.
count
{
if
0
<
v
.
count
{
var
h
:
String
=
"H:"
var
h
:
String
=
"H:"
var
d
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
var
d
:
Dictionary
<
String
,
AnyObject
>
=
Dictionary
<
String
,
AnyObject
>
()
var
i
:
Int
=
0
var
i
:
Int
=
v
.
count
-
1
for
b
in
v
{
for
b
in
v
{
let
k
:
String
=
"b
\(
i
)
"
let
k
:
String
=
"b
\(
i
)
"
...
@@ -441,17 +441,17 @@ public class ImageCardView : MaterialPulseView {
...
@@ -441,17 +441,17 @@ public class ImageCardView : MaterialPulseView {
h
+=
"[
\(
k
)
]"
h
+=
"[
\(
k
)
]"
if
0
==
i
++
{
if
0
==
i
--
{
h
+=
"-(right_left)-"
}
else
{
h
+=
"-(right)-"
h
+=
"-(right)-"
}
else
{
h
+=
"-(right_left)-"
}
}
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
}
}
}
}
...
...
Source/MaterialTextLayer.swift
View file @
e4c4ea9a
...
@@ -106,22 +106,16 @@ public class MaterialTextLayer : CATextLayer {
...
@@ -106,22 +106,16 @@ public class MaterialTextLayer : CATextLayer {
didSet
{
didSet
{
switch
lineBreakMode
{
switch
lineBreakMode
{
case
.
ByWordWrapping
:
// Wrap at word boundaries, default
case
.
ByWordWrapping
:
// Wrap at word boundaries, default
wrapped
=
true
truncationMode
=
kCATruncationNone
truncationMode
=
kCATruncationNone
case
.
ByCharWrapping
:
// Wrap at character boundaries
case
.
ByCharWrapping
:
// Wrap at character boundaries
wrapped
=
true
truncationMode
=
kCATruncationNone
truncationMode
=
kCATruncationNone
case
.
ByClipping
:
// Simply clip
case
.
ByClipping
:
// Simply clip
wrapped
=
false
truncationMode
=
kCATruncationNone
truncationMode
=
kCATruncationNone
case
.
ByTruncatingHead
:
// Truncate at head of line: "...wxyz"
case
.
ByTruncatingHead
:
// Truncate at head of line: "...wxyz"
wrapped
=
false
truncationMode
=
kCATruncationStart
truncationMode
=
kCATruncationStart
case
.
ByTruncatingTail
:
// Truncate at tail of line: "abcd..."
case
.
ByTruncatingTail
:
// Truncate at tail of line: "abcd..."
wrapped
=
false
truncationMode
=
kCATruncationEnd
truncationMode
=
kCATruncationEnd
case
.
ByTruncatingMiddle
:
// Truncate middle of line: "ab...yz"
case
.
ByTruncatingMiddle
:
// Truncate middle of line: "ab...yz"
wrapped
=
false
truncationMode
=
kCATruncationMiddle
truncationMode
=
kCATruncationMiddle
}
}
}
}
...
...
Source/MaterialTheme.swift
View file @
e4c4ea9a
...
@@ -193,8 +193,8 @@ public extension MaterialTheme.navigationBarView {
...
@@ -193,8 +193,8 @@ public extension MaterialTheme.navigationBarView {
public
static
var
contentInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
Square2
)
public
static
var
contentInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
Square2
)
public
static
var
titleLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
20
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
titleLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
20
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
detailLabelInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
None
)
public
static
var
detailLabelInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
None
)
public
static
var
leftButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
8
,
bottom
:
0
,
right
:
-
8
)
public
static
var
leftButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
rightButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
-
8
,
bottom
:
0
,
right
:
8
)
public
static
var
rightButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
// border
// border
public
static
var
borderWidth
:
MaterialBorder
=
.
None
public
static
var
borderWidth
:
MaterialBorder
=
.
None
...
...
Source/NavigationBarView.swift
View file @
e4c4ea9a
...
@@ -294,7 +294,7 @@ public class NavigationBarView : MaterialView {
...
@@ -294,7 +294,7 @@ public class NavigationBarView : MaterialView {
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
leftButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
left
,
"left_right"
:
leftButtonsInsetsRef
!.
left
+
leftButtonsInsetsRef
!.
right
],
views
:
d
))
}
}
}
}
...
@@ -322,7 +322,7 @@ public class NavigationBarView : MaterialView {
...
@@ -322,7 +322,7 @@ public class NavigationBarView : MaterialView {
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInsetsRef
!.
bottom
+
rightButtonsInsetsRef
!.
bottom
)
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
right
,
"right_left"
:
rightButtonsInsetsRef
!.
right
+
rightButtonsInsetsRef
!.
left
],
views
:
d
))
}
}
}
}
...
...
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