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
3b733415
Commit
3b733415
authored
Aug 27, 2021
by
Dmitry Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IOS-210: Fix the temperature forecast widget (Blinking)
parent
1d41afe7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
+5
-0
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/HourlyTemperatureView.swift
+1
-1
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/TemperatureGraphView.swift
+6
-1
No files found.
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
View file @
3b733415
...
...
@@ -84,6 +84,11 @@
isEnabled =
"YES"
>
</EnvironmentVariable>
<EnvironmentVariable
key =
"CG_NUMERICS_SHOW_BACKTRACE"
value =
""
isEnabled =
"NO"
>
</EnvironmentVariable>
<EnvironmentVariable
key =
"_XCWidgetDefaultView"
value =
"timeline"
isEnabled =
"NO"
>
...
...
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/HourlyTemperatureView.swift
View file @
3b733415
...
...
@@ -33,7 +33,7 @@ struct HourlyTemperatureView: View {
}
)
if
hourlyWeather
.
count
>=
2
{
if
hourlyWeather
.
count
>=
2
&&
hourlyStackFrame
.
width
>
0
&&
hourlyStackFrame
.
height
>
55
{
TemperatureGraphView
(
hourlyWeather
:
hourlyWeather
,
viewModel
:
.
init
(
graphSize
:
.
init
(
width
:
hourlyStackFrame
.
width
,
height
:
hourlyStackFrame
.
height
-
55
),
...
...
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/TemperatureGraphView.swift
View file @
3b733415
...
...
@@ -121,7 +121,10 @@ struct TemperatureGraphView: View {
let
diff
=
maxTemp
-
minTemp
for
index
in
0
..<
hourlyWeather
.
count
{
let
multiply
=
CGFloat
(
maxTemp
-
hourlyWeather
[
index
]
.
temp
)
/
CGFloat
(
diff
)
var
multiply
:
CGFloat
=
0.5
if
diff
>
0
{
multiply
=
CGFloat
(
maxTemp
-
hourlyWeather
[
index
]
.
temp
)
/
CGFloat
(
diff
)
}
let
space
:
CGFloat
=
index
>
0
&&
index
<=
3
?
graphViewModel
.
spacingPerItem
:
0
if
index
==
0
{
...
...
@@ -136,6 +139,8 @@ struct TemperatureGraphView: View {
}
private
mutating
func
prepareSectionsAndLinePath
()
{
print
(
"[DEBUG] graphInset:
\(
graphViewModel
.
graphInset
)
graphSize:
\(
graphViewModel
.
graphSize
)
"
)
let
startPoint
=
CGPoint
(
x
:
graphViewModel
.
graphInset
.
leading
,
y
:
points
.
first
?
.
y
??
0
)
let
endPoint
=
CGPoint
(
x
:
graphViewModel
.
graphSize
.
width
,
y
:
points
.
last
?
.
y
??
0
)
...
...
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