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
8c60d126
Commit
8c60d126
authored
May 01, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-22: better layout for the smart text label.
parent
8cb57fc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
1Weather/UI/View controllers/Today/Cells/TodayForecastCell.swift
+8
-7
No files found.
1Weather/UI/View controllers/Today/Cells/TodayForecastCell.swift
View file @
8c60d126
...
...
@@ -14,7 +14,7 @@ class TodayForecastCell: UITableViewCell {
private
let
cityImageView
=
UIImageView
()
private
let
temperatureLabel
=
UILabel
()
private
let
forecastDescriptionLabel
=
UILabel
()
private
let
feelsLike
Label
=
UILabel
()
private
let
smartText
Label
=
UILabel
()
private
let
forecastImageView
=
UIImageView
()
private
let
smartTextProvider
=
SmartTextProvider
()
...
...
@@ -46,9 +46,8 @@ class TodayForecastCell: UITableViewCell {
temperatureLabel
.
text
=
location
.
today
?
.
temp
?
.
settingsConverted
.
shortString
let
maxTemp
=
location
.
today
?
.
maxTemp
?
.
settingsConverted
.
shortString
??
"--"
let
minTemp
=
location
.
today
?
.
minTemp
?
.
settingsConverted
.
shortString
??
"--"
let
feelstemp
=
location
.
today
?
.
apparentTemp
?
.
settingsConverted
.
shortString
??
"--"
forecastDescriptionLabel
.
text
=
"
\(
location
.
today
?
.
type
.
localized
(
isDay
:
location
.
today
?
.
isDay
??
true
)
??
""
)
|
\(
maxTemp
)
/
\(
minTemp
)
"
feelsLike
Label
.
text
=
smartTextProvider
.
smartText
(
for
:
location
)
smartText
Label
.
text
=
smartTextProvider
.
smartText
(
for
:
location
)
forecastImageView
.
image
=
location
.
today
?
.
type
.
image
(
isDay
:
location
.
today
?
.
isDay
??
true
)
}
...
...
@@ -56,7 +55,7 @@ class TodayForecastCell: UITableViewCell {
private
func
updateUI
()
{
temperatureLabel
.
textColor
=
ThemeManager
.
currentTheme
.
primaryTextColor
forecastDescriptionLabel
.
textColor
=
ThemeManager
.
currentTheme
.
primaryTextColor
feelsLike
Label
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
smartText
Label
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
contentView
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
container
.
backgroundColor
=
ThemeManager
.
currentTheme
.
containerBackgroundColor
...
...
@@ -129,13 +128,15 @@ private extension TodayForecastCell {
}
func
prepareFeelsLikeLabel
()
{
feelsLikeLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
12
)
container
.
addSubview
(
feelsLikeLabel
)
smartTextLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
12
)
smartTextLabel
.
numberOfLines
=
0
container
.
addSubview
(
smartTextLabel
)
feelsLike
Label
.
snp
.
makeConstraints
{
(
make
)
in
smartText
Label
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
equalToSuperview
()
.
inset
(
18
)
make
.
top
.
equalTo
(
forecastDescriptionLabel
.
snp
.
bottom
)
.
offset
(
5
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
25
)
make
.
right
.
equalToSuperview
()
.
inset
(
18
)
}
}
...
...
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