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
12fd3d0c
Commit
12fd3d0c
authored
Sep 01, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: progression updates
parent
4683c8fa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
14 deletions
+36
-14
MaterialKit.xcodeproj/project.pbxproj
+4
-2
Source/BasicCard.swift
+23
-3
Source/ImageCard.swift
+0
-0
Source/Layout.swift
+1
-1
Source/Roboto.swift
+6
-6
Source/TextView.swift
+2
-2
No files found.
MaterialKit.xcodeproj/project.pbxproj
View file @
12fd3d0c
...
...
@@ -10,7 +10,6 @@
657CD02A1B8EE0D3008C0029
/* MaterialCard.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A94D1081B8A3F5100F586A5
/* MaterialCard.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
657CD02C1B8EE0D3008C0029
/* SideNavController.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65B965861B8BEEC60055B139
/* SideNavController.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
657CD02D1B8EE0D3008C0029
/* MaterialButton.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65B9657D1B8A7C330055B139
/* MaterialButton.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
657CD02E1B8EE0D3008C0029
/* (null) in Headers */
=
{
isa
=
PBXBuildFile
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
657CD02F1B8EE0D3008C0029
/* ImageCard.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A94D10A1B8A485C00F586A5
/* ImageCard.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
65B9657E1B8A7C330055B139
/* MaterialButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65B9657D1B8A7C330055B139
/* MaterialButton.swift */
;
};
65B965871B8BEEC60055B139
/* SideNavController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65B965861B8BEEC60055B139
/* SideNavController.swift */
;
};
...
...
@@ -35,6 +34,8 @@
963832881B8908180015F710
/* Layout.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
};
963832891B89097D0015F710
/* Layout.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832871B8908180015F710
/* Layout.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96B57D4E1B90AF7D00DE7BBB
/* MaterialTheme.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96B57D4D1B90AF7D00DE7BBB
/* MaterialTheme.swift */
;
};
96C910ED1B95804B00E7CE5C
/* MaterialTheme.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96B57D4D1B90AF7D00DE7BBB
/* MaterialTheme.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96C910EE1B95804B00E7CE5C
/* ImageRevealCard.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A3A3B6F1B8EB582005F16BC
/* ImageRevealCard.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A3A3B701B8EB582005F16BC
/* ImageRevealCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A3A3B6F1B8EB582005F16BC
/* ImageRevealCard.swift */
;
};
9A94D0F91B895C8C00F586A5
/* Roboto.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9AAC38531B89559900FE6B2D
/* Roboto.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9A94D0FA1B895EA500F586A5
/* LICENSE in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
963832631B88E5BF0015F710
/* LICENSE */
;
};
...
...
@@ -271,7 +272,8 @@
657CD02A1B8EE0D3008C0029
/* MaterialCard.swift in Headers */
,
657CD02C1B8EE0D3008C0029
/* SideNavController.swift in Headers */
,
657CD02D1B8EE0D3008C0029
/* MaterialButton.swift in Headers */
,
657CD02E1B8EE0D3008C0029
/* (null) in Headers */
,
96C910ED1B95804B00E7CE5C
/* MaterialTheme.swift in Headers */
,
96C910EE1B95804B00E7CE5C
/* ImageRevealCard.swift in Headers */
,
657CD02F1B8EE0D3008C0029
/* ImageCard.swift in Headers */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
Source/BasicCard.swift
View file @
12fd3d0c
...
...
@@ -18,7 +18,7 @@
import
UIKit
public
class
BasicCard
:
MaterialCard
{
public
class
BasicCard
:
MaterialCard
,
Comparable
,
Equatable
{
//
// :name: layoutConstraints
//
...
...
@@ -104,7 +104,7 @@ public class BasicCard : MaterialCard {
l
.
setTranslatesAutoresizingMaskIntoConstraints
(
false
)
l
.
textColor
=
MaterialTheme
.
white
.
color
l
.
backgroundColor
=
MaterialTheme
.
clear
.
color
l
.
font
=
Roboto
.
lightWithSize
(
1
2
)
l
.
font
=
Roboto
.
lightWithSize
(
1
6
)
l
.
numberOfLines
=
0
l
.
lineBreakMode
=
.
ByWordWrapping
prepareCard
()
...
...
@@ -204,7 +204,7 @@ public class BasicCard : MaterialCard {
// text
titleLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"H:|-(verticalSpace)-[titleLabel]-(verticalSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalSpace"
:
verticalSpace
],
views
:
[
"titleLabel"
:
titleLabel
!
]))
titleLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(verticalSpace)-[titleLabel(height)]-(verticalSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalSpace"
:
verticalSpace
,
"height"
:
titleLabel
!.
font
.
pointSize
],
views
:
[
"titleLabel"
:
titleLabel
!
]))
titleLabelContainer
!.
addConstraints
(
Layout
.
constraint
(
"V:|-(verticalSpace)-[titleLabel(height)]-(verticalSpace)-|"
,
options
:
nil
,
metrics
:
[
"verticalSpace"
:
verticalSpace
,
"height"
:
titleLabel
!.
font
.
pointSize
+
verticalSpace
],
views
:
[
"titleLabel"
:
titleLabel
!
]))
}
// detail
...
...
@@ -270,3 +270,23 @@ public class BasicCard : MaterialCard {
}
}
}
public
func
==
(
lhs
:
BasicCard
,
rhs
:
BasicCard
)
->
Bool
{
return
lhs
.
tag
==
rhs
.
tag
}
public
func
<=
(
lhs
:
BasicCard
,
rhs
:
BasicCard
)
->
Bool
{
return
lhs
.
tag
<=
rhs
.
tag
}
public
func
>=
(
lhs
:
BasicCard
,
rhs
:
BasicCard
)
->
Bool
{
return
lhs
.
tag
>=
rhs
.
tag
}
public
func
>
(
lhs
:
BasicCard
,
rhs
:
BasicCard
)
->
Bool
{
return
lhs
.
tag
>
rhs
.
tag
}
public
func
<
(
lhs
:
BasicCard
,
rhs
:
BasicCard
)
->
Bool
{
return
lhs
.
tag
<
rhs
.
tag
}
Source/ImageCard.swift
View file @
12fd3d0c
This diff is collapsed.
Click to expand it.
Source/Layout.swift
View file @
12fd3d0c
...
...
@@ -85,7 +85,7 @@ public struct Layout {
/**
:name: expandToParentWithPad
*/
public
static
func
expandToParentWithPad
(
parent
:
UIView
,
child
:
UIView
,
left
:
CGFloat
=
0
,
bottom
:
CGFloat
=
0
,
right
:
CGFloat
=
0
,
top
:
CGFloat
=
0
)
{
public
static
func
expandToParentWithPad
(
parent
:
UIView
,
child
:
UIView
,
top
:
CGFloat
=
0
,
left
:
CGFloat
=
0
,
bottom
:
CGFloat
=
0
,
right
:
CGFloat
=
0
)
{
let
views
:
Dictionary
<
String
,
AnyObject
>
=
[
"child"
:
child
]
parent
.
addConstraints
(
constraint
(
"H:|-(left)-[child]-(right)-|"
,
options
:
nil
,
metrics
:
[
"left"
:
left
,
"right"
:
right
],
views
:
views
))
parent
.
addConstraints
(
constraint
(
"V:|-(top)-[child]-(bottom)-|"
,
options
:
nil
,
metrics
:
[
"bottom"
:
bottom
,
"top"
:
top
],
views
:
views
))
...
...
Source/Roboto.swift
View file @
12fd3d0c
...
...
@@ -20,22 +20,22 @@ import UIKit
public
struct
Roboto
{
public
static
func
lightWithSize
(
size
:
CGFloat
)
->
UIFont
{
if
let
light
=
UIFont
(
name
:
"Roboto-Light"
,
size
:
size
)
{
return
light
if
let
f
=
UIFont
(
name
:
"Roboto-Light"
,
size
:
size
)
{
return
f
}
return
UIFont
.
systemFontOfSize
(
size
)
}
public
static
func
mediumWithSize
(
size
:
CGFloat
)
->
UIFont
{
if
let
light
=
UIFont
(
name
:
"Roboto-Medium"
,
size
:
size
)
{
return
light
if
let
f
=
UIFont
(
name
:
"Roboto-Medium"
,
size
:
size
)
{
return
f
}
return
UIFont
.
systemFontOfSize
(
size
)
}
public
static
func
regularWithSize
(
size
:
CGFloat
)
->
UIFont
{
if
let
light
=
UIFont
(
name
:
"Roboto-Regular"
,
size
:
size
)
{
return
light
if
let
f
=
UIFont
(
name
:
"Roboto-Regular"
,
size
:
size
)
{
return
f
}
return
UIFont
.
systemFontOfSize
(
size
)
}
...
...
Source/TextView.swift
View file @
12fd3d0c
...
...
@@ -66,7 +66,7 @@ public class TextView: UITextView {
:name: placeholderColor
:description: The placeholder color.
*/
public
var
placeholderColor
:
UIColor
=
MaterialTheme
.
blueGrey
.
lighten
3
{
public
var
placeholderColor
:
UIColor
=
MaterialTheme
.
blueGrey
.
lighten
1
{
didSet
{
label
.
textColor
=
placeholderColor
}
...
...
@@ -143,7 +143,7 @@ public class TextView: UITextView {
backgroundColor
=
MaterialTheme
.
clear
.
color
textColor
=
MaterialTheme
.
black
.
color
label
.
font
=
font
label
.
textColor
=
MaterialTheme
.
blueGrey
.
lighten3
label
.
textColor
=
placeholderColor
label
.
textAlignment
=
textAlignment
label
.
text
=
placeholder
label
.
numberOfLines
=
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