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
c20e6381
Commit
c20e6381
authored
Oct 12, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating ImageCardView to allow dynamic image sizing
parent
95bee682
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
Source/ImageCardView.swift
+4
-2
Source/MaterialTheme.swift
+5
-5
No files found.
Source/ImageCardView.swift
View file @
c20e6381
...
@@ -35,12 +35,14 @@ public class ImageCardView : MaterialPulseView {
...
@@ -35,12 +35,14 @@ public class ImageCardView : MaterialPulseView {
if
let
v
=
value
{
if
let
v
=
value
{
imageLayer
.
contents
=
v
.
CGImage
imageLayer
.
contents
=
v
.
CGImage
if
0
==
imageLayer
.
frame
.
size
.
height
{
if
0
==
imageLayer
.
frame
.
size
.
height
{
imageLayer
.
frame
.
size
.
height
=
200
imageLayer
.
frame
.
size
.
height
=
v
.
size
.
height
}
}
imageLayer
.
hidden
=
false
}
}
else
{
else
{
imageLayer
.
contents
=
nil
imageLayer
.
frame
=
CGRectZero
imageLayer
.
frame
=
CGRectZero
imageLayer
.
removeFromSuperlayer
()
imageLayer
.
hidden
=
true
}
}
reloadView
()
reloadView
()
}
}
...
...
Source/MaterialTheme.swift
View file @
c20e6381
...
@@ -143,11 +143,11 @@ public extension MaterialTheme.imageCardView {
...
@@ -143,11 +143,11 @@ public extension MaterialTheme.imageCardView {
// shape
// shape
public
static
var
masksToBounds
:
Bool
=
true
public
static
var
masksToBounds
:
Bool
=
true
public
static
var
cornerRadius
:
MaterialRadius
=
.
None
public
static
var
cornerRadius
:
MaterialRadius
=
.
None
public
static
var
contentInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
Square
3
)
public
static
var
contentInsetsRef
:
MaterialInsetsType
=
MaterialInsetsToValue
(
.
Square
2
)
public
static
var
titleLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
0
,
left
:
8
,
bottom
:
0
,
right
:
8
)
public
static
var
titleLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
16
,
bottom
:
0
,
right
:
16
)
public
static
var
detailLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
0
,
left
:
8
,
bottom
:
16
,
right
:
8
)
public
static
var
detailLabelInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
16
,
bottom
:
16
,
right
:
16
)
public
static
var
leftButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
8
,
bottom
:
-
8
,
right
:
0
)
public
static
var
leftButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
public
static
var
rightButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
-
8
,
right
:
8
)
public
static
var
rightButtonsInsetsRef
:
MaterialInsetsType
=
(
top
:
8
,
left
:
0
,
bottom
:
0
,
right
:
0
)
// border
// border
public
static
var
borderWidth
:
MaterialBorder
=
.
None
public
static
var
borderWidth
:
MaterialBorder
=
.
None
...
...
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