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
7e5548ed
Commit
7e5548ed
authored
Aug 29, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue-7: BasicCard working with configuration through logical process
parent
b32fe056
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Source/BasicCard.swift
+6
-6
Source/MaterialTheme.swift
+1
-1
No files found.
Source/BasicCard.swift
View file @
7e5548ed
...
...
@@ -36,7 +36,7 @@ public class BasicCard : MaterialCard {
public
var
divider
:
UIView
?
{
didSet
{
divider
!.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
divider
!.
backgroundColor
=
MaterialTheme
.
indigo
.
lighten1
divider
!.
backgroundColor
=
MaterialTheme
.
blueGrey
.
color
addSubview
(
divider
!
)
prepareCard
()
}
...
...
@@ -118,9 +118,9 @@ public class BasicCard : MaterialCard {
if
nil
!=
buttons
{
// divider
if
nil
!=
divider
{
// layoutConstraints += Layout.constraint("H:|-(0)-[divider(2)]-(0)-
|", options: nil, metrics: nil, views: ["divider": divider!])
//
views["divider"] = divider!
// verticalFormat += "-(10)-[divider
]"
layoutConstraints
+=
Layout
.
constraint
(
"H:|[divider]
|"
,
options
:
nil
,
metrics
:
nil
,
views
:
[
"divider"
:
divider
!
])
views
[
"divider"
]
=
divider
!
verticalFormat
+=
"-(20)-[divider(1)
]"
}
// buttons
var
horizontalFormat
:
String
=
"H:|"
...
...
@@ -131,11 +131,11 @@ public class BasicCard : MaterialCard {
buttonViews
[
"button
\(
i
)
"
]
=
button
views
[
"button
\(
i
)
"
]
=
button
as
AnyObject
horizontalFormat
+=
"-(10)-[button
\(
i
)
]"
layoutConstraints
+=
Layout
.
constraint
(
verticalFormat
+
"-(
5
)-[button
\(
i
)
]-(10)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
)
layoutConstraints
+=
Layout
.
constraint
(
verticalFormat
+
"-(
10
)-[button
\(
i
)
]-(10)-|"
,
options
:
nil
,
metrics
:
nil
,
views
:
views
)
}
layoutConstraints
+=
Layout
.
constraint
(
horizontalFormat
,
options
:
nil
,
metrics
:
nil
,
views
:
buttonViews
)
}
else
{
verticalFormat
+=
"-(
1
0)-|"
verticalFormat
+=
"-(
2
0)-|"
}
if
0
<
layoutConstraints
.
count
{
...
...
Source/MaterialTheme.swift
View file @
7e5548ed
...
...
@@ -367,7 +367,7 @@ public struct MaterialTheme {
public
static
let
lighten3
:
UIColor
=
UIColor
(
red
:
159
/
255
,
green
:
168
/
255
,
blue
:
218
/
255
,
alpha
:
1
)
public
static
let
lighten2
:
UIColor
=
UIColor
(
red
:
121
/
255
,
green
:
134
/
255
,
blue
:
203
/
255
,
alpha
:
1
)
public
static
let
lighten1
:
UIColor
=
UIColor
(
red
:
92
/
255
,
green
:
107
/
255
,
blue
:
192
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
63
/
255
,
green
:
81
/
255
,
blue
:
181
/
255
,
alpha
:
1
)
public
static
let
color
:
UIColor
=
UIColor
(
red
:
96
/
255
,
green
:
125
/
255
,
blue
:
139
/
255
,
alpha
:
1
)
public
static
let
darken1
:
UIColor
=
UIColor
(
red
:
84
/
255
,
green
:
110
/
255
,
blue
:
122
/
255
,
alpha
:
1
)
public
static
let
darken2
:
UIColor
=
UIColor
(
red
:
48
/
255
,
green
:
63
/
255
,
blue
:
159
/
255
,
alpha
:
1
)
public
static
let
darken3
:
UIColor
=
UIColor
(
red
:
55
/
255
,
green
:
71
/
255
,
blue
:
79
/
255
,
alpha
:
1
)
...
...
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