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
817985c6
Commit
817985c6
authored
Sep 25, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated contents* defaults
parent
973a8015
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
32 deletions
+27
-32
Source/MaterialTheme+View.swift
+6
-6
Source/MaterialView.swift
+18
-7
Source/NavigationBarView.swift
+3
-19
No files found.
Source/MaterialTheme+View.swift
View file @
817985c6
...
...
@@ -37,7 +37,6 @@ public extension MaterialTheme.view {
public
static
let
shadowOffset
:
CGSize
=
CGSizeMake
(
0.2
,
0.2
)
public
static
let
shadowOpacity
:
Float
=
0.5
public
static
let
shadowRadius
:
CGFloat
=
1
public
static
let
contentScale
:
CGFloat
=
UIScreen
.
mainScreen
()
.
scale
public
static
let
masksToBounds
:
Bool
=
false
// color
...
...
@@ -47,8 +46,9 @@ public extension MaterialTheme.view {
public
static
let
userInteractionEnabled
:
Bool
=
true
// image
public
static
let
imageGravity
:
String
=
kCAGravityCenter
public
static
let
imageContentsRect
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
let
contentsGravity
:
String
=
kCAGravityResizeAspectFill
public
static
let
contentsRect
:
CGRect
=
CGRectMake
(
0
,
0
,
1
,
1
)
public
static
let
contentsScale
:
CGFloat
=
UIScreen
.
mainScreen
()
.
scale
}
// navigation
...
...
@@ -64,7 +64,6 @@ public extension MaterialTheme.navigation {
public
static
let
shadowOffset
:
CGSize
=
MaterialTheme
.
view
.
shadowOffset
public
static
let
shadowOpacity
:
Float
=
MaterialTheme
.
view
.
shadowOpacity
public
static
let
shadowRadius
:
CGFloat
=
MaterialTheme
.
view
.
shadowRadius
public
static
let
contentScale
:
CGFloat
=
MaterialTheme
.
view
.
contentScale
public
static
let
masksToBounds
:
Bool
=
MaterialTheme
.
view
.
masksToBounds
// color
...
...
@@ -75,7 +74,8 @@ public extension MaterialTheme.navigation {
public
static
let
userInteractionEnabled
:
Bool
=
false
// image
public
static
let
imageGravity
:
String
=
MaterialTheme
.
view
.
imageGravity
public
static
let
imageContentsRect
:
CGRect
=
MaterialTheme
.
view
.
imageContentsRect
public
static
let
contentsGravity
:
String
=
MaterialTheme
.
view
.
contentsGravity
public
static
let
contentsRect
:
CGRect
=
MaterialTheme
.
view
.
contentsRect
public
static
let
contentsScale
:
CGFloat
=
MaterialTheme
.
view
.
contentsScale
}
Source/MaterialView.swift
View file @
817985c6
...
...
@@ -30,20 +30,29 @@ public class MaterialView: UIView {
}
/**
:name:
image
Gravity
:name:
contents
Gravity
*/
public
var
imageGravity
:
String
?
{
public
var
contentsGravity
:
String
!
{
didSet
{
layer
.
contentsGravity
=
nil
==
imageGravity
?
MaterialTheme
.
view
.
imageGravity
:
imageGravity
!
layer
.
contentsGravity
=
contentsGravity
}
}
/**
:name:
imageC
ontentsRect
:name:
c
ontentsRect
*/
public
var
imageContentsRect
:
CGRect
?
{
public
var
contentsRect
:
CGRect
!
{
didSet
{
layer
.
contentsRect
=
nil
==
imageContentsRect
?
MaterialTheme
.
view
.
imageContentsRect
:
imageContentsRect
!
layer
.
contentsRect
=
contentsRect
}
}
/**
:name: contentsScale
*/
public
var
contentsScale
:
CGFloat
!
{
didSet
{
layer
.
contentsScale
=
contentsScale
}
}
...
...
@@ -189,7 +198,9 @@ public class MaterialView: UIView {
:name: prepareLayer
*/
internal
func
prepareLayer
()
{
layer
.
contentsScale
=
MaterialTheme
.
view
.
contentScale
contentsScale
=
MaterialTheme
.
view
.
contentsScale
contentsGravity
=
MaterialTheme
.
view
.
contentsGravity
contentsRect
=
MaterialTheme
.
view
.
contentsRect
shadowColor
=
MaterialTheme
.
view
.
shadowColor
shadowOffset
=
MaterialTheme
.
view
.
shadowOffset
shadowOpacity
=
MaterialTheme
.
view
.
shadowOpacity
...
...
Source/NavigationBarView.swift
View file @
817985c6
...
...
@@ -29,24 +29,6 @@ public class NavigationBarView: MaterialView {
}
/**
:name: imageGravity
*/
public
override
var
imageGravity
:
String
?
{
didSet
{
layer
.
contentsGravity
=
nil
==
imageGravity
?
MaterialTheme
.
navigation
.
imageGravity
:
imageGravity
!
}
}
/**
:name: imageContentsRect
*/
public
override
var
imageContentsRect
:
CGRect
?
{
didSet
{
layer
.
contentsRect
=
nil
==
imageContentsRect
?
MaterialTheme
.
navigation
.
imageContentsRect
:
imageContentsRect
!
}
}
/**
:name: init
*/
public
convenience
init
()
{
...
...
@@ -69,7 +51,9 @@ public class NavigationBarView: MaterialView {
:name: prepareLayer
*/
internal
override
func
prepareLayer
()
{
layer
.
contentsScale
=
MaterialTheme
.
navigation
.
contentScale
contentsScale
=
MaterialTheme
.
navigation
.
contentsScale
contentsGravity
=
MaterialTheme
.
navigation
.
contentsGravity
contentsRect
=
MaterialTheme
.
navigation
.
contentsRect
shadowColor
=
MaterialTheme
.
navigation
.
shadowColor
shadowOffset
=
MaterialTheme
.
navigation
.
shadowOffset
shadowOpacity
=
MaterialTheme
.
navigation
.
shadowOpacity
...
...
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