Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
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
1weather
Commits
615d2924
Commit
615d2924
authored
May 26, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Embeded AirQualityCell into container view
parent
dbf49ea8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+4
-4
1Weather/UI/View controllers/Today/Cells/TodayAirQualityCell/TodayAirQualityCell.swift
+25
-11
No files found.
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
615d2924
...
...
@@ -12,7 +12,7 @@
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
5
4
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
5
5
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
...
...
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
615d2924
...
...
@@ -9,21 +9,21 @@
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
42
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
55
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
2.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
43
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
56
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
3.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
44
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
57
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
4.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
...
...
@@ -51,7 +51,7 @@
<
k
e
y
>
isShown
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
1
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
54
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
...
...
1Weather/UI/View controllers/Today/Cells/TodayAirQualityCell/TodayAirQualityCell.swift
View file @
615d2924
...
...
@@ -17,6 +17,7 @@ private struct AirQualityDataType: CirqueDataType {
class
TodayAirQualityCell
:
UITableViewCell
{
//Private
private
let
headingLabel
=
UILabel
()
private
let
container
=
UIView
()
private
let
cirqueView
=
CirqueView
()
private
let
valueCircle
=
CAShapeLayer
()
private
let
airQualityValueLabel
=
UILabel
()
...
...
@@ -29,6 +30,7 @@ class TodayAirQualityCell: UITableViewCell {
prepareCell
()
prepareHeading
()
prepareContainer
()
prepareAirLabels
()
prepareValueProgress
()
prepareStackView
()
...
...
@@ -111,17 +113,29 @@ private extension TodayAirQualityCell {
}
}
func
prepareContainer
()
{
container
.
backgroundColor
=
ThemeManager
.
currentTheme
.
containerBackgroundColor
container
.
layer
.
cornerRadius
=
12
contentView
.
addSubview
(
container
)
container
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
18
)
make
.
top
.
equalTo
(
headingLabel
.
snp
.
bottom
)
.
offset
(
20
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
15
)
}
}
func
prepareAirLabels
()
{
airQualityLabel
.
lineBreakMode
=
.
byWordWrapping
airQualityLabel
.
numberOfLines
=
0
airQualityValueLabel
.
font
=
AppFont
.
SFPro
.
bold
(
size
:
18
)
airQualityValueLabel
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
cont
entView
.
addSubview
(
airQualityValueLabel
)
cont
ainer
.
addSubview
(
airQualityValueLabel
)
airQualityLabel
.
numberOfLines
=
0
airQualityLabel
.
lineBreakMode
=
.
byWordWrapping
airQualityLabel
.
textAlignment
=
.
left
cont
entView
.
addSubview
(
airQualityLabel
)
cont
ainer
.
addSubview
(
airQualityLabel
)
airDescLabel
.
textAlignment
=
.
left
airDescLabel
.
numberOfLines
=
0
...
...
@@ -129,23 +143,23 @@ private extension TodayAirQualityCell {
airDescLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
16
)
airDescLabel
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
airDescLabel
.
text
=
""
cont
entView
.
addSubview
(
airDescLabel
)
cont
ainer
.
addSubview
(
airDescLabel
)
//Constraints
airQualityValueLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
equalToSuperview
()
.
inset
(
72
)
make
.
top
.
equalTo
(
headingLabel
.
snp
.
bottom
)
.
offset
(
7
2
)
.
priority
(
999
)
make
.
left
.
equalToSuperview
()
.
inset
(
54
)
make
.
top
.
equalTo
Superview
()
.
inset
(
5
2
)
.
priority
(
999
)
}
airQualityLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
equalTo
(
airQualityValueLabel
.
snp
.
right
)
.
offset
(
54
)
make
.
top
.
equalTo
(
headingLabel
.
snp
.
bottom
)
.
offset
(
4
8
)
make
.
top
.
equalTo
Superview
()
.
inset
(
2
8
)
// make.centerY.equalTo(airQualityValueLabel)
make
.
right
.
equalToSuperview
()
.
inset
(
48
)
}
airDescLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
50
)
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
32
)
make
.
top
.
greaterThanOrEqualTo
(
airQualityLabel
.
snp
.
bottom
)
.
offset
(
8
)
// also see prepareValueProgress
}
...
...
@@ -155,13 +169,13 @@ private extension TodayAirQualityCell {
valueCircle
.
strokeColor
=
UIColor
(
hex
:
0xe9ebfc
)
.
cgColor
valueCircle
.
fillColor
=
UIColor
.
clear
.
cgColor
valueCircle
.
lineWidth
=
2
cont
entView
.
layer
.
addSublayer
(
valueCircle
)
cont
ainer
.
layer
.
addSublayer
(
valueCircle
)
cirqueView
.
lineWidth
=
6
cirqueView
.
stepSize
=
0.01
cirqueView
.
roundLineCorners
=
true
cirqueView
.
backgroundColor
=
.
clear
cont
entView
.
addSubview
(
cirqueView
)
cont
ainer
.
addSubview
(
cirqueView
)
cirqueView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
width
.
height
.
equalTo
(
77
)
...
...
@@ -177,10 +191,10 @@ private extension TodayAirQualityCell {
stackView
.
axis
=
.
vertical
stackView
.
distribution
=
.
fillProportionally
stackView
.
clipsToBounds
=
false
cont
entView
.
addSubview
(
stackView
)
cont
ainer
.
addSubview
(
stackView
)
stackView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
50
)
make
.
left
.
right
.
equalToSuperview
()
.
inset
(
27
)
make
.
top
.
equalTo
(
airDescLabel
.
snp
.
bottom
)
.
offset
(
15
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
15
)
}
...
...
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