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
eb4851dc
Commit
eb4851dc
authored
Jun 05, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated MaterialLayout project to Layout project
parent
d7c78951
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
32 additions
and
71 deletions
+32
-71
Examples/Material.xcworkspace/contents.xcworkspacedata
+1
-1
Examples/Programmatic/Layout/Layout.xcodeproj/project.pbxproj
+0
-0
Examples/Programmatic/Layout/Layout.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+1
-1
Examples/Programmatic/Layout/Layout/AppDelegate.swift
+0
-1
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/Contents.json
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x-1.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@3x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x-1.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@3x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@2x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@3x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76@2x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-83.5@2x.png
+0
-0
Examples/Programmatic/Layout/Layout/Assets.xcassets/Contents.json
+0
-0
Examples/Programmatic/Layout/Layout/Base.lproj/LaunchScreen.storyboard
+0
-0
Examples/Programmatic/Layout/Layout/Info.plist
+1
-1
Examples/Programmatic/Layout/Layout/ViewController.swift
+29
-67
No files found.
Examples/Material.xcworkspace/contents.xcworkspacedata
View file @
eb4851dc
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
location =
"group:Programmatic/MaterialIcon/MaterialIcon.xcodeproj"
>
location =
"group:Programmatic/MaterialIcon/MaterialIcon.xcodeproj"
>
</FileRef>
</FileRef>
<FileRef
<FileRef
location =
"group:Programmatic/
MaterialLayout/Material
Layout.xcodeproj"
>
location =
"group:Programmatic/
Layout/
Layout.xcodeproj"
>
</FileRef>
</FileRef>
<FileRef
<FileRef
location =
"group:Programmatic/Grid/Grid.xcodeproj"
>
location =
"group:Programmatic/Grid/Grid.xcodeproj"
>
...
...
Examples/Programmatic/
MaterialLayout/Material
Layout.xcodeproj/project.pbxproj
→
Examples/Programmatic/
Layout/
Layout.xcodeproj/project.pbxproj
View file @
eb4851dc
This diff is collapsed.
Click to expand it.
Examples/Programmatic/
MaterialLayout/Material
Layout.xcodeproj/project.xcworkspace/contents.xcworkspacedata
→
Examples/Programmatic/
Layout/
Layout.xcodeproj/project.xcworkspace/contents.xcworkspacedata
View file @
eb4851dc
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
<Workspace
<Workspace
version =
"1.0"
>
version =
"1.0"
>
<FileRef
<FileRef
location =
"self:
Material
Layout.xcodeproj"
>
location =
"self:Layout.xcodeproj"
>
</FileRef>
</FileRef>
</Workspace>
</Workspace>
Examples/Programmatic/
MaterialLayout/Material
Layout/AppDelegate.swift
→
Examples/Programmatic/
Layout/
Layout/AppDelegate.swift
View file @
eb4851dc
...
@@ -35,7 +35,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
...
@@ -35,7 +35,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var
window
:
UIWindow
?
var
window
:
UIWindow
?
func
application
(
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
NSObject
:
AnyObject
]?)
->
Bool
{
func
application
(
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
NSObject
:
AnyObject
]?)
->
Bool
{
window
=
UIWindow
(
frame
:
UIScreen
.
mainScreen
()
.
bounds
)
window
=
UIWindow
(
frame
:
UIScreen
.
mainScreen
()
.
bounds
)
window
!.
rootViewController
=
ViewController
()
window
!.
rootViewController
=
ViewController
()
...
...
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/Contents.json
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/Contents.json
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x-1.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x-1.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@2x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@3x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-29@3x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x-1.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x-1.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@2x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@3x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-40@3x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@2x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@2x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@3x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-60@3x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76@2x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-76@2x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-83.5@2x.png
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/AppIcon.appiconset/MaterialColorsAppIcon_Icon-83.5@2x.png
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Assets.xcassets/Contents.json
→
Examples/Programmatic/
Layout/
Layout/Assets.xcassets/Contents.json
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Base.lproj/LaunchScreen.storyboard
→
Examples/Programmatic/
Layout/
Layout/Base.lproj/LaunchScreen.storyboard
View file @
eb4851dc
File moved
Examples/Programmatic/
MaterialLayout/Material
Layout/Info.plist
→
Examples/Programmatic/
Layout/
Layout/Info.plist
View file @
eb4851dc
...
@@ -31,9 +31,9 @@
...
@@ -31,9 +31,9 @@
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
~
ipad
<
/k
e
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
~
ipad
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
...
...
Examples/Programmatic/
MaterialLayout/Material
Layout/ViewController.swift
→
Examples/Programmatic/
Layout/
Layout/ViewController.swift
View file @
eb4851dc
...
@@ -30,8 +30,8 @@
...
@@ -30,8 +30,8 @@
/**
/**
Layout is an excellent tool to ease the use of AutoLayout. The following
Layout is an excellent tool to ease the use of AutoLayout. The following
examples demonstrate laying out a collection of UILabel objects
, both vertically
examples demonstrate laying out a collection of UILabel objects
in the vertical,
and horizontally
.
horizontal, anc center positions
.
*/
*/
import
UIKit
import
UIKit
...
@@ -41,9 +41,8 @@ class ViewController: UIViewController {
...
@@ -41,9 +41,8 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
// prepareAlignToParentHorizontallyExample()
prepareAlignToParentHorizontallyAndVerticallyExample
()
// prepareAlignToParentVerticallyExample()
// prepareCenterExample()
prepareCenterExample
()
}
}
/// General preparation statements.
/// General preparation statements.
...
@@ -52,7 +51,7 @@ class ViewController: UIViewController {
...
@@ -52,7 +51,7 @@ class ViewController: UIViewController {
}
}
/// Layout views horizontally with equal width.
/// Layout views horizontally with equal width.
private
func
prepareAlignToParentHorizontallyExample
()
{
private
func
prepareAlignToParentHorizontally
AndVertically
Example
()
{
let
label1
:
UILabel
=
UILabel
()
let
label1
:
UILabel
=
UILabel
()
label1
.
backgroundColor
=
MaterialColor
.
red
.
base
label1
.
backgroundColor
=
MaterialColor
.
red
.
base
label1
.
text
=
"A"
label1
.
text
=
"A"
...
@@ -88,76 +87,39 @@ class ViewController: UIViewController {
...
@@ -88,76 +87,39 @@ class ViewController: UIViewController {
}
}
}
}
/// Layout views vertically with equal height.
// Lays out test views to the center of different axes
private
func
prepareAlignToParentVerticallyExample
()
{
private
func
prepareCenterExample
()
{
let
label1
:
UILabel
=
UILabel
()
let
length
:
CGFloat
=
100
label1
.
backgroundColor
=
MaterialColor
.
red
.
base
label1
.
text
=
"A"
label1
.
textAlignment
=
.
Center
let
label2
:
UILabel
=
UILabel
()
let
labelCX
=
UILabel
()
label2
.
backgroundColor
=
MaterialColor
.
green
.
base
labelCX
.
backgroundColor
=
MaterialColor
.
grey
.
base
label2
.
text
=
"B"
labelCX
.
text
=
"centerX"
label2
.
textAlignment
=
.
Center
labelCX
.
textAlignment
=
.
Center
labelCX
.
layer
.
cornerRadius
=
length
/
2.0
let
label3
:
UILabel
=
UILabel
()
labelCX
.
clipsToBounds
=
true
label3
.
backgroundColor
=
MaterialColor
.
blue
.
base
label3
.
text
=
"C"
label3
.
textAlignment
=
.
Center
let
label4
:
UILabel
=
UILabel
()
label4
.
backgroundColor
=
MaterialColor
.
yellow
.
base
label4
.
text
=
"D"
label4
.
textAlignment
=
.
Center
let
children
:
Array
<
UIView
>
=
[
label1
,
label2
,
label3
,
label4
]
// Align the labels vertically with an equal height.
view
.
layout
.
vertically
(
children
,
top
:
100
,
bottom
:
100
,
spacing
:
10
)
// Align the labels horizontally with an equal width.
view
.
layout
.
horizontally
(
children
,
left
:
100
,
right
:
100
)
// Print out the dimensions of the labels.
for
v
in
children
{
v
.
layoutIfNeeded
()
print
(
v
.
frame
)
}
}
// Lays out test views to the center of different axes
private
func
prepareCenterExample
()
{
let
length
:
CGFloat
=
100
let
labelCX
=
UILabel
()
labelCX
.
backgroundColor
=
MaterialColor
.
grey
.
base
labelCX
.
text
=
"centerX"
labelCX
.
textAlignment
=
.
Center
labelCX
.
layer
.
cornerRadius
=
length
/
2.0
labelCX
.
clipsToBounds
=
true
view
.
layout
.
size
(
labelCX
,
width
:
length
,
height
:
length
)
view
.
layout
.
size
(
labelCX
,
width
:
length
,
height
:
length
)
view
.
layout
.
centerHorizontally
(
labelCX
)
view
.
layout
.
centerHorizontally
(
labelCX
)
let
labelCY
=
UILabel
()
let
labelCY
=
UILabel
()
labelCY
.
backgroundColor
=
MaterialColor
.
grey
.
base
labelCY
.
backgroundColor
=
MaterialColor
.
grey
.
base
labelCY
.
text
=
"centerY"
labelCY
.
text
=
"centerY"
labelCY
.
textAlignment
=
.
Center
labelCY
.
textAlignment
=
.
Center
labelCY
.
layer
.
cornerRadius
=
length
/
2.0
labelCY
.
layer
.
cornerRadius
=
length
/
2.0
labelCY
.
clipsToBounds
=
true
labelCY
.
clipsToBounds
=
true
view
.
layout
.
size
(
labelCY
,
width
:
length
,
height
:
length
)
view
.
layout
.
size
(
labelCY
,
width
:
length
,
height
:
length
)
view
.
layout
.
centerVertically
(
labelCY
)
view
.
layout
.
centerVertically
(
labelCY
)
let
labelCXY
=
UILabel
()
let
labelCXY
=
UILabel
()
labelCXY
.
backgroundColor
=
MaterialColor
.
grey
.
base
labelCXY
.
backgroundColor
=
MaterialColor
.
grey
.
base
labelCXY
.
text
=
"centerXY"
labelCXY
.
text
=
"centerXY"
labelCXY
.
textAlignment
=
.
Center
labelCXY
.
textAlignment
=
.
Center
labelCXY
.
layer
.
cornerRadius
=
length
/
2.0
labelCXY
.
layer
.
cornerRadius
=
length
/
2.0
labelCXY
.
clipsToBounds
=
true
labelCXY
.
clipsToBounds
=
true
view
.
layout
.
size
(
labelCXY
,
width
:
length
,
height
:
length
)
view
.
layout
.
size
(
labelCXY
,
width
:
length
,
height
:
length
)
view
.
layout
.
center
(
labelCXY
)
view
.
layout
.
center
(
labelCXY
)
}
}
}
}
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