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
507affe6
Commit
507affe6
authored
Sep 26, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added border types
parent
30598cc5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
13 deletions
+40
-13
Source/FlatButton.swift
+2
-1
Source/MaterialBorder.swift
+2
-2
Source/MaterialButton.swift
+12
-3
Source/MaterialTheme.swift
+8
-4
Source/MaterialView.swift
+14
-3
Source/NavigationBarView.swift
+2
-0
No files found.
Source/FlatButton.swift
View file @
507affe6
...
...
@@ -29,7 +29,8 @@ public class FlatButton : MaterialButton {
backgroundColor
=
MaterialColor
.
red
.
base
//MaterialTheme.button.flat.backgroudColor
cornerRadius
=
MaterialTheme
.
button
.
flat
.
cornerRadius
contentInsets
=
MaterialTheme
.
button
.
flat
.
contentInsets
border
=
MaterialTheme
.
button
.
flat
.
border
borderWidth
=
MaterialTheme
.
button
.
flat
.
borderWidth
borderColor
=
MaterialTheme
.
button
.
flat
.
bordercolor
}
//
...
...
Source/MaterialBorder.swift
View file @
507affe6
...
...
@@ -32,8 +32,8 @@ public enum MaterialBorder : MaterialBorderType {
/**
:name: MaterialBorderToValue
*/
public
func
MaterialBorderToValue
(
border
:
MaterialBorder
)
->
MaterialBorderType
{
switch
border
{
public
func
MaterialBorderToValue
(
width
:
MaterialBorder
)
->
MaterialBorderType
{
switch
width
{
case
.
None
:
return
0
case
.
Thin
:
...
...
Source/MaterialButton.swift
View file @
507affe6
...
...
@@ -127,11 +127,20 @@ public class MaterialButton : UIButton {
}
/**
:name: border
:name: border
Width
*/
public
var
border
:
MaterialBorder
!
{
public
var
border
Width
:
MaterialBorder
!
{
didSet
{
layer
.
borderWidth
=
MaterialBorderToValue
(
border
)
layer
.
borderWidth
=
MaterialBorderToValue
(
borderWidth
)
}
}
/**
:name: borderColor
*/
public
var
borderColor
:
UIColor
!
{
didSet
{
layer
.
borderColor
=
borderColor
.
CGColor
}
}
...
...
Source/MaterialTheme.swift
View file @
507affe6
...
...
@@ -45,7 +45,8 @@ public extension MaterialTheme.view {
public
static
let
cornerRadius
:
MaterialRadius
=
.
Square
// border
public
static
let
border
:
MaterialBorder
=
.
None
public
static
let
borderWidth
:
MaterialBorder
=
.
None
public
static
let
bordercolor
:
UIColor
=
MaterialColor
.
black
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
white
...
...
@@ -80,7 +81,8 @@ public extension MaterialTheme.navigation {
public
static
let
cornerRadius
:
MaterialRadius
=
MaterialTheme
.
view
.
cornerRadius
// border
public
static
let
border
:
MaterialBorder
=
MaterialTheme
.
view
.
border
public
static
let
borderWidth
:
MaterialBorder
=
MaterialTheme
.
view
.
borderWidth
public
static
let
bordercolor
:
UIColor
=
MaterialTheme
.
view
.
bordercolor
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
blue
.
accent3
...
...
@@ -111,7 +113,8 @@ public extension MaterialTheme.button {
public
static
let
contentInsets
:
MaterialInsets
=
.
Inset2
// border
public
static
let
border
:
MaterialBorder
=
MaterialTheme
.
view
.
border
public
static
let
borderWidth
:
MaterialBorder
=
MaterialTheme
.
view
.
borderWidth
public
static
let
bordercolor
:
UIColor
=
MaterialTheme
.
view
.
bordercolor
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialColor
.
clear
...
...
@@ -139,7 +142,8 @@ public extension MaterialTheme.button.flat {
public
static
let
contentInsets
:
MaterialInsets
=
MaterialTheme
.
button
.
contentInsets
// border
public
static
let
border
:
MaterialBorder
=
MaterialTheme
.
button
.
border
public
static
let
borderWidth
:
MaterialBorder
=
MaterialTheme
.
button
.
borderWidth
public
static
let
bordercolor
:
UIColor
=
MaterialTheme
.
button
.
bordercolor
// color
public
static
let
backgroudColor
:
UIColor
=
MaterialTheme
.
button
.
backgroudColor
...
...
Source/MaterialView.swift
View file @
507affe6
...
...
@@ -172,11 +172,20 @@ public class MaterialView: UIView {
}
/**
:name: border
:name: border
Width
*/
public
var
border
:
MaterialBorder
!
{
public
var
border
Width
:
MaterialBorder
!
{
didSet
{
layer
.
borderWidth
=
MaterialBorderToValue
(
border
)
layer
.
borderWidth
=
MaterialBorderToValue
(
borderWidth
)
}
}
/**
:name: borderColor
*/
public
var
borderColor
:
UIColor
!
{
didSet
{
layer
.
borderColor
=
borderColor
.
CGColor
}
}
...
...
@@ -256,6 +265,8 @@ public class MaterialView: UIView {
zPosition
=
MaterialTheme
.
view
.
zPosition
masksToBounds
=
MaterialTheme
.
view
.
masksToBounds
cornerRadius
=
MaterialTheme
.
view
.
cornerRadius
borderWidth
=
.
None
borderColor
=
MaterialTheme
.
view
.
bordercolor
}
}
Source/NavigationBarView.swift
View file @
507affe6
...
...
@@ -59,5 +59,7 @@ public class NavigationBarView: MaterialView {
zPosition
=
MaterialTheme
.
navigation
.
zPosition
masksToBounds
=
MaterialTheme
.
navigation
.
masksToBounds
cornerRadius
=
MaterialTheme
.
navigation
.
cornerRadius
borderWidth
=
.
None
borderColor
=
MaterialTheme
.
view
.
bordercolor
}
}
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