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
391ed843
Unverified
Commit
391ed843
authored
Dec 14, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: cards can now be dynamically sized and return a height based on content sizes
parent
59af6439
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
Sources/iOS/Card.swift
+3
-13
No files found.
Sources/iOS/Card.swift
View file @
391ed843
...
@@ -31,11 +31,6 @@
...
@@ -31,11 +31,6 @@
import
UIKit
import
UIKit
open
class
Card
:
PulseView
{
open
class
Card
:
PulseView
{
/// Will layout the view.
open
var
willLayout
:
Bool
{
return
0
<
width
&&
nil
!=
superview
}
/// A container view for subviews.
/// A container view for subviews.
open
let
container
=
UIView
()
open
let
container
=
UIView
()
...
@@ -182,12 +177,7 @@ open class Card: PulseView {
...
@@ -182,12 +177,7 @@ open class Card: PulseView {
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
guard
willLayout
else
{
return
}
container
.
width
=
width
container
.
width
=
width
reload
()
reload
()
}
}
...
@@ -235,9 +225,9 @@ open class Card: PulseView {
...
@@ -235,9 +225,9 @@ open class Card: PulseView {
*/
*/
@discardableResult
@discardableResult
open
func
prepare
(
view
:
UIView
,
with
insets
:
EdgeInsets
,
from
top
:
CGFloat
)
->
CGFloat
{
open
func
prepare
(
view
:
UIView
,
with
insets
:
EdgeInsets
,
from
top
:
CGFloat
)
->
CGFloat
{
let
t
=
insets
.
top
+
top
let
y
=
insets
.
top
+
top
view
.
y
=
t
view
.
y
=
y
view
.
x
=
insets
.
left
view
.
x
=
insets
.
left
let
w
=
container
.
width
-
insets
.
left
-
insets
.
right
let
w
=
container
.
width
-
insets
.
left
-
insets
.
right
...
@@ -251,7 +241,7 @@ open class Card: PulseView {
...
@@ -251,7 +241,7 @@ open class Card: PulseView {
view
.
width
=
w
view
.
width
=
w
view
.
height
=
h
view
.
height
=
h
return
t
+
h
+
insets
.
bottom
return
y
+
h
+
insets
.
bottom
}
}
/**
/**
...
...
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