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
2ea0efcd
Commit
2ea0efcd
authored
Oct 16, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated code style for DialogView
parent
8c2aa5f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
Sources/iOS/DialogView.swift
+29
-29
No files found.
Sources/iOS/DialogView.swift
View file @
2ea0efcd
...
...
@@ -33,6 +33,30 @@
import
UIKit
private
struct
Constants
{
struct
titleArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
24
,
left
:
24
,
bottom
:
20
,
right
:
24
)
}
struct
contentArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
0
,
left
:
24
,
bottom
:
24
,
right
:
24
)
static
let
insetsNoTitle
=
UIEdgeInsets
(
top
:
20
,
left
:
24
,
bottom
:
24
,
right
:
24
)
}
struct
buttonArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
8
,
left
:
8
,
bottom
:
8
,
right
:
8
)
static
let
insetsStacked
=
UIEdgeInsets
(
top
:
6
,
left
:
8
,
bottom
:
14
,
right
:
8
)
}
struct
button
{
static
let
insets
=
UIEdgeInsets
(
top
:
0
,
left
:
8
,
bottom
:
0
,
right
:
8
)
static
let
minWidth
:
CGFloat
=
64
static
let
height
:
CGFloat
=
36
static
let
interimStacked
:
CGFloat
=
12
static
let
interim
:
CGFloat
=
8
}
}
private
class
DialogScrollView
:
UIScrollView
{
/// A weak reference to DialogView.
weak
var
dialogView
:
DialogView
?
...
...
@@ -99,14 +123,14 @@ open class DialogView: View, Themeable {
open
override
func
sizeThatFits
(
_
size
:
CGSize
)
->
CGSize
{
var
w
:
CGFloat
=
0
func
set
W
(
_
newW
:
CGFloat
)
{
w
=
max
(
w
,
newW
)
func
set
MaxWidth
(
_
width
:
CGFloat
)
{
w
=
max
(
w
,
width
)
w
=
min
(
w
,
size
.
width
)
}
set
W
(
titleAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
set
W
(
buttonAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
set
W
(
contentAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
set
MaxWidth
(
titleAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
set
MaxWidth
(
buttonAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
set
MaxWidth
(
contentAreaSizeThatFits
(
width
:
size
.
width
)
.
width
)
var
h
:
CGFloat
=
0
h
+=
titleAreaSizeThatFits
(
width
:
w
)
.
height
...
...
@@ -404,27 +428,3 @@ private extension UILabel {
return
empty
}
}
private
struct
Constants
{
struct
titleArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
24
,
left
:
24
,
bottom
:
20
,
right
:
24
)
}
struct
contentArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
0
,
left
:
24
,
bottom
:
24
,
right
:
24
)
static
let
insetsNoTitle
=
UIEdgeInsets
(
top
:
20
,
left
:
24
,
bottom
:
24
,
right
:
24
)
}
struct
buttonArea
{
static
let
insets
=
UIEdgeInsets
(
top
:
8
,
left
:
8
,
bottom
:
8
,
right
:
8
)
static
let
insetsStacked
=
UIEdgeInsets
(
top
:
6
,
left
:
8
,
bottom
:
14
,
right
:
8
)
}
struct
button
{
static
let
insets
=
UIEdgeInsets
(
top
:
0
,
left
:
8
,
bottom
:
0
,
right
:
8
)
static
let
minWidth
:
CGFloat
=
64
static
let
height
:
CGFloat
=
36
static
let
interimStacked
:
CGFloat
=
12
static
let
interim
:
CGFloat
=
8
}
}
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