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
151c2d2d
Unverified
Commit
151c2d2d
authored
Sep 23, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Button-example-polish: updated alignment for refined Button example
parent
ad808f3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
Examples/Programmatic/Button/Button/ViewController.swift
+16
-5
No files found.
Examples/Programmatic/Button/Button/ViewController.swift
View file @
151c2d2d
...
...
@@ -32,7 +32,6 @@ import UIKit
import
Material
struct
ButtonLayout
{
struct
Flat
{
static
let
width
:
CGFloat
=
120
static
let
height
:
CGFloat
=
36
...
...
@@ -73,7 +72,10 @@ class ViewController: UIViewController {
private
func
prepareFlatButton
()
{
let
button
=
FlatButton
(
title
:
"Flat Button"
,
titleColor
:
Color
.
blue
.
base
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Flat
.
width
)
.
height
(
ButtonLayout
.
Flat
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Flat
.
offsetY
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Flat
.
width
)
.
height
(
ButtonLayout
.
Flat
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Flat
.
offsetY
)
}
private
func
prepareRaisedButton
()
{
...
...
@@ -81,19 +83,28 @@ class ViewController: UIViewController {
button
.
pulseColor
=
Color
.
white
button
.
backgroundColor
=
Color
.
blue
.
base
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Raised
.
width
)
.
height
(
ButtonLayout
.
Raised
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Raised
.
offsetY
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Raised
.
width
)
.
height
(
ButtonLayout
.
Raised
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Raised
.
offsetY
)
}
private
func
prepareFabButton
()
{
let
button
=
FabButton
(
image
:
Icon
.
cm
.
add
,
tintColor
:
Color
.
white
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Fab
.
diameter
)
.
height
(
ButtonLayout
.
Fab
.
diameter
)
.
center
()
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Fab
.
diameter
)
.
height
(
ButtonLayout
.
Fab
.
diameter
)
.
center
()
}
private
func
prepareIconButton
()
{
let
button
=
IconButton
(
image
:
Icon
.
cm
.
search
,
tintColor
:
Color
.
blue
.
base
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Icon
.
width
)
.
height
(
ButtonLayout
.
Icon
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Icon
.
offsetY
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Icon
.
width
)
.
height
(
ButtonLayout
.
Icon
.
height
)
.
center
(
offsetY
:
ButtonLayout
.
Icon
.
offsetY
)
}
}
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