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
b82c8b09
Commit
b82c8b09
authored
Jul 19, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on LargeTemperatureWidget
parent
dad43b2e
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
87 additions
and
65 deletions
+87
-65
1Weather.xcodeproj/project.pbxproj
+10
-0
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
+1
-1
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+2
-2
OneWeatherUI/OneWeatherUI.xcodeproj/project.pbxproj
+4
-4
OneWeatherUI/OneWeatherUI/Widgets/Precipitation/MediumPrecipitationWidgetView.swift
+1
-1
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/WidgetTopView.swift
+15
-3
OneWeatherUI/OneWeatherUI/Widgets/Temperature/LargeTemperatureWidgetView.swift
+11
-38
OneWeatherUI/OneWeatherUI/Widgets/Temperature/MediumTemperatureWidgetView.swift
+1
-1
OneWeatherUI/OneWeatherUI/Widgets/ViewModels/WidgetViewModel.swift
+5
-5
OneWeatherUI/OneWeatherUI/Widgets/ViewModels/WidgetViewModelMock.swift
+5
-3
OneWeatherWidget/Data/WeatherEntry.swift
+13
-0
OneWeatherWidget/UI/WidgetPlaceholderView.swift
+1
-1
OneWeatherWidget/ViewModels/ForecastWidgetViewModel.swift
+16
-4
OneWeatherWidget/Widgets/TemperatureWidget.swift
+2
-2
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
b82c8b09
...
@@ -90,6 +90,9 @@
...
@@ -90,6 +90,9 @@
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B52653D56700A3CDBE
/* splash.json */
;
};
CD5692B62653D56700A3CDBE
/* splash.json in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5692B52653D56700A3CDBE
/* splash.json */
;
};
CD58529026A01F0E00D61021
/* PrecipitationWidget.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD58528F26A01F0E00D61021
/* PrecipitationWidget.swift */
;
};
CD58529026A01F0E00D61021
/* PrecipitationWidget.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD58528F26A01F0E00D61021
/* PrecipitationWidget.swift */
;
};
CD58529226A02B3200D61021
/* PromotionWidgetViewWrapper.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD58529126A02B3100D61021
/* PromotionWidgetViewWrapper.swift */
;
};
CD58529226A02B3200D61021
/* PromotionWidgetViewWrapper.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD58529126A02B3100D61021
/* PromotionWidgetViewWrapper.swift */
;
};
CD5909CE26A59A4B00448579
/* OneWeatherUI.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5909CD26A59A4B00448579
/* OneWeatherUI.framework */
;
settings
=
{
ATTRIBUTES
=
(
Required
,
);
};
};
CD5909D026A59AAA00448579
/* OneWeatherUI.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5909CF26A59AAA00448579
/* OneWeatherUI.framework */
;
settings
=
{
ATTRIBUTES
=
(
Weak
,
);
};
};
CD5909D126A59AAA00448579
/* OneWeatherUI.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD5909CF26A59AAA00448579
/* OneWeatherUI.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
CD593BC226088A5900C93428
/* TimePeriodOffsetHolder.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BC126088A5900C93428
/* TimePeriodOffsetHolder.swift */
;
};
CD593BC226088A5900C93428
/* TimePeriodOffsetHolder.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BC126088A5900C93428
/* TimePeriodOffsetHolder.swift */
;
};
CD593BCC2608A4F200C93428
/* ForecastDailyCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BCB2608A4F200C93428
/* ForecastDailyCell.swift */
;
};
CD593BCC2608A4F200C93428
/* ForecastDailyCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BCB2608A4F200C93428
/* ForecastDailyCell.swift */
;
};
CD593BCF2608A50900C93428
/* ForecastHourlyCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BCE2608A50900C93428
/* ForecastHourlyCell.swift */
;
};
CD593BCF2608A50900C93428
/* ForecastHourlyCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD593BCE2608A50900C93428
/* ForecastHourlyCell.swift */
;
};
...
@@ -283,6 +286,7 @@
...
@@ -283,6 +286,7 @@
CD3884562657BA8B0070FD6F
/* CoreDataStorage.framework in Embed Frameworks */
,
CD3884562657BA8B0070FD6F
/* CoreDataStorage.framework in Embed Frameworks */
,
CD3883C32657B6A10070FD6F
/* BlendHealthSource.framework in Embed Frameworks */
,
CD3883C32657B6A10070FD6F
/* BlendHealthSource.framework in Embed Frameworks */
,
CD3884842657BBCC0070FD6F
/* DelayedSaveStorage.framework in Embed Frameworks */
,
CD3884842657BBCC0070FD6F
/* DelayedSaveStorage.framework in Embed Frameworks */
,
CD5909D126A59AAA00448579
/* OneWeatherUI.framework in Embed Frameworks */
,
);
);
name
=
"Embed Frameworks"
;
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -397,6 +401,8 @@
...
@@ -397,6 +401,8 @@
CD5692B52653D56700A3CDBE
/* splash.json */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.json
;
path
=
splash.json
;
sourceTree
=
"<group>"
;
};
CD5692B52653D56700A3CDBE
/* splash.json */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text.json
;
path
=
splash.json
;
sourceTree
=
"<group>"
;
};
CD58528F26A01F0E00D61021
/* PrecipitationWidget.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PrecipitationWidget.swift
;
sourceTree
=
"<group>"
;
};
CD58528F26A01F0E00D61021
/* PrecipitationWidget.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PrecipitationWidget.swift
;
sourceTree
=
"<group>"
;
};
CD58529126A02B3100D61021
/* PromotionWidgetViewWrapper.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PromotionWidgetViewWrapper.swift
;
sourceTree
=
"<group>"
;
};
CD58529126A02B3100D61021
/* PromotionWidgetViewWrapper.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PromotionWidgetViewWrapper.swift
;
sourceTree
=
"<group>"
;
};
CD5909CD26A59A4B00448579
/* OneWeatherUI.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
path
=
OneWeatherUI.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
CD5909CF26A59AAA00448579
/* OneWeatherUI.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
path
=
OneWeatherUI.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
CD593BC126088A5900C93428
/* TimePeriodOffsetHolder.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TimePeriodOffsetHolder.swift
;
sourceTree
=
"<group>"
;
};
CD593BC126088A5900C93428
/* TimePeriodOffsetHolder.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
TimePeriodOffsetHolder.swift
;
sourceTree
=
"<group>"
;
};
CD593BCB2608A4F200C93428
/* ForecastDailyCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastDailyCell.swift
;
sourceTree
=
"<group>"
;
};
CD593BCB2608A4F200C93428
/* ForecastDailyCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastDailyCell.swift
;
sourceTree
=
"<group>"
;
};
CD593BCE2608A50900C93428
/* ForecastHourlyCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastHourlyCell.swift
;
sourceTree
=
"<group>"
;
};
CD593BCE2608A50900C93428
/* ForecastHourlyCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ForecastHourlyCell.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -547,6 +553,7 @@
...
@@ -547,6 +553,7 @@
files
=
(
files
=
(
CE14445F2638B6CF008E2162
/* StoreKit.framework in Frameworks */
,
CE14445F2638B6CF008E2162
/* StoreKit.framework in Frameworks */
,
CD3883C22657B6A10070FD6F
/* BlendHealthSource.framework in Frameworks */
,
CD3883C22657B6A10070FD6F
/* BlendHealthSource.framework in Frameworks */
,
CD5909D026A59AAA00448579
/* OneWeatherUI.framework in Frameworks */
,
CE13B97B2626FB11007CBD4D
/* PSMLocationSDK.xcframework in Frameworks */
,
CE13B97B2626FB11007CBD4D
/* PSMLocationSDK.xcframework in Frameworks */
,
CDFE45BC26566EF50021A29F
/* WDTWeatherSource.framework in Frameworks */
,
CDFE45BC26566EF50021A29F
/* WDTWeatherSource.framework in Frameworks */
,
CD3884552657BA8B0070FD6F
/* CoreDataStorage.framework in Frameworks */
,
CD3884552657BA8B0070FD6F
/* CoreDataStorage.framework in Frameworks */
,
...
@@ -565,6 +572,7 @@
...
@@ -565,6 +572,7 @@
files
=
(
files
=
(
CD1B713D2660F95000916E71
/* SwiftUI.framework in Frameworks */
,
CD1B713D2660F95000916E71
/* SwiftUI.framework in Frameworks */
,
CE7298CC267A34F5002745D0
/* BlendHealthSource.framework in Frameworks */
,
CE7298CC267A34F5002745D0
/* BlendHealthSource.framework in Frameworks */
,
CD5909CE26A59A4B00448579
/* OneWeatherUI.framework in Frameworks */
,
CD1B713B2660F95000916E71
/* WidgetKit.framework in Frameworks */
,
CD1B713B2660F95000916E71
/* WidgetKit.framework in Frameworks */
,
CE7298D0267A34F8002745D0
/* DelayedSaveStorage.framework in Frameworks */
,
CE7298D0267A34F8002745D0
/* DelayedSaveStorage.framework in Frameworks */
,
CE7298C9267A34F3002745D0
/* BlendFIPSSource.framework in Frameworks */
,
CE7298C9267A34F3002745D0
/* BlendFIPSSource.framework in Frameworks */
,
...
@@ -1390,6 +1398,8 @@
...
@@ -1390,6 +1398,8 @@
DBFD169AA2AA6A3CB5B68BB5
/* Frameworks */
=
{
DBFD169AA2AA6A3CB5B68BB5
/* Frameworks */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
CD5909CF26A59AAA00448579
/* OneWeatherUI.framework */
,
CD5909CD26A59A4B00448579
/* OneWeatherUI.framework */
,
CD5181BF269EEB61008E6B04
/* CoreLocation.framework */
,
CD5181BF269EEB61008E6B04
/* CoreLocation.framework */
,
CD7D3183268F1438000D01FA
/* OneWeatherUI.framework */
,
CD7D3183268F1438000D01FA
/* OneWeatherUI.framework */
,
CDEF70E2266E10B600BA40D6
/* OneWeatherCore.framework */
,
CDEF70E2266E10B600BA40D6
/* OneWeatherCore.framework */
,
...
...
1Weather.xcodeproj/xcshareddata/xcschemes/OneWeatherWidgetExtension.xcscheme
View file @
b82c8b09
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
</EnvironmentVariable>
</EnvironmentVariable>
<EnvironmentVariable
<EnvironmentVariable
key =
"_XCWidgetFamily"
key =
"_XCWidgetFamily"
value =
"
medium
"
value =
"
large
"
isEnabled =
"YES"
>
isEnabled =
"YES"
>
</EnvironmentVariable>
</EnvironmentVariable>
</EnvironmentVariables>
</EnvironmentVariables>
...
...
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
b82c8b09
...
@@ -12,12 +12,12 @@
...
@@ -12,12 +12,12 @@
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherNotificationServiceExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
2
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
OneWeatherWidgetExtension.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
4
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
7
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
k
e
y
>
PG
(
Playground
)
1.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
...
...
OneWeatherUI/OneWeatherUI.xcodeproj/project.pbxproj
View file @
b82c8b09
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
CD2E07BF269C5834001CBF40
/* SF-Pro-Display-Thin.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD2E07BE269C5834001CBF40
/* SF-Pro-Display-Thin.otf */
;
};
CD2E07BF269C5834001CBF40
/* SF-Pro-Display-Thin.otf in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD2E07BE269C5834001CBF40
/* SF-Pro-Display-Thin.otf */
;
};
CD2E07C1269C5ABF001CBF40
/* HourlyTemperatureView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
;
};
CD2E07C1269C5ABF001CBF40
/* HourlyTemperatureView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
;
};
CD3C83C326933ABD0087A225
/* MediumTemperatureWidgetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3C83C226933ABC0087A225
/* MediumTemperatureWidgetView.swift */
;
};
CD3C83C326933ABD0087A225
/* MediumTemperatureWidgetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD3C83C226933ABC0087A225
/* MediumTemperatureWidgetView.swift */
;
};
CD4319FA26A00E090019A232
/*
MediumWidgetTopView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4319F926A00E090019A232
/* Medium
WidgetTopView.swift */
;
};
CD4319FA26A00E090019A232
/*
WidgetTopView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4319F926A00E090019A232
/*
WidgetTopView.swift */
;
};
CD4319FC26A014CF0019A232
/* MediumPrecipitationWidgetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4319FB26A014CF0019A232
/* MediumPrecipitationWidgetView.swift */
;
};
CD4319FC26A014CF0019A232
/* MediumPrecipitationWidgetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD4319FB26A014CF0019A232
/* MediumPrecipitationWidgetView.swift */
;
};
CD50556126983C2F006776AB
/* CubicCurveAlgorithm.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD50556026983C2E006776AB
/* CubicCurveAlgorithm.swift */
;
};
CD50556126983C2F006776AB
/* CubicCurveAlgorithm.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD50556026983C2E006776AB
/* CubicCurveAlgorithm.swift */
;
};
CD7D3161268EEF49000D01FA
/* CityNameView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD7D315F268EEF48000D01FA
/* CityNameView.swift */
;
};
CD7D3161268EEF49000D01FA
/* CityNameView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD7D315F268EEF48000D01FA
/* CityNameView.swift */
;
};
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
CD2E07BE269C5834001CBF40
/* SF-Pro-Display-Thin.otf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"SF-Pro-Display-Thin.otf"
;
sourceTree
=
"<group>"
;
};
CD2E07BE269C5834001CBF40
/* SF-Pro-Display-Thin.otf */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
"SF-Pro-Display-Thin.otf"
;
sourceTree
=
"<group>"
;
};
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HourlyTemperatureView.swift
;
sourceTree
=
"<group>"
;
};
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HourlyTemperatureView.swift
;
sourceTree
=
"<group>"
;
};
CD3C83C226933ABC0087A225
/* MediumTemperatureWidgetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MediumTemperatureWidgetView.swift
;
sourceTree
=
"<group>"
;
};
CD3C83C226933ABC0087A225
/* MediumTemperatureWidgetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MediumTemperatureWidgetView.swift
;
sourceTree
=
"<group>"
;
};
CD4319F926A00E090019A232
/*
MediumWidgetTopView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Medium
WidgetTopView.swift
;
sourceTree
=
"<group>"
;
};
CD4319F926A00E090019A232
/*
WidgetTopView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
WidgetTopView.swift
;
sourceTree
=
"<group>"
;
};
CD4319FB26A014CF0019A232
/* MediumPrecipitationWidgetView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MediumPrecipitationWidgetView.swift
;
sourceTree
=
"<group>"
;
};
CD4319FB26A014CF0019A232
/* MediumPrecipitationWidgetView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MediumPrecipitationWidgetView.swift
;
sourceTree
=
"<group>"
;
};
CD50556026983C2E006776AB
/* CubicCurveAlgorithm.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CubicCurveAlgorithm.swift
;
sourceTree
=
"<group>"
;
};
CD50556026983C2E006776AB
/* CubicCurveAlgorithm.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CubicCurveAlgorithm.swift
;
sourceTree
=
"<group>"
;
};
CD6F063D269854A7002A99C2
/* BezierKit.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
path
=
BezierKit.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
CD6F063D269854A7002A99C2
/* BezierKit.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
path
=
BezierKit.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
...
@@ -213,7 +213,7 @@
...
@@ -213,7 +213,7 @@
CDC3F85926946D0700AAE3BF
/* HourlyView.swift */
,
CDC3F85926946D0700AAE3BF
/* HourlyView.swift */
,
CD1BF3AE26981B5300F60E2E
/* TemperatureGraphView.swift */
,
CD1BF3AE26981B5300F60E2E
/* TemperatureGraphView.swift */
,
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
,
CD2E07C0269C5ABF001CBF40
/* HourlyTemperatureView.swift */
,
CD4319F926A00E090019A232
/*
Medium
WidgetTopView.swift */
,
CD4319F926A00E090019A232
/* WidgetTopView.swift */
,
);
);
path
=
SharedViews
;
path
=
SharedViews
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -394,7 +394,7 @@
...
@@ -394,7 +394,7 @@
CD7D3187268F1F2E000D01FA
/* UIImage+Resize.swift in Sources */
,
CD7D3187268F1F2E000D01FA
/* UIImage+Resize.swift in Sources */
,
CD1BF3B2269823BA00F60E2E
/* GraphViewModel.swift in Sources */
,
CD1BF3B2269823BA00F60E2E
/* GraphViewModel.swift in Sources */
,
CD50556126983C2F006776AB
/* CubicCurveAlgorithm.swift in Sources */
,
CD50556126983C2F006776AB
/* CubicCurveAlgorithm.swift in Sources */
,
CD4319FA26A00E090019A232
/*
Medium
WidgetTopView.swift in Sources */
,
CD4319FA26A00E090019A232
/* WidgetTopView.swift in Sources */
,
CD7D3178268EFB9E000D01FA
/* WidgetViewModelMock.swift in Sources */
,
CD7D3178268EFB9E000D01FA
/* WidgetViewModelMock.swift in Sources */
,
CD7D316F268EF2BC000D01FA
/* WidgetViewModel.swift in Sources */
,
CD7D316F268EF2BC000D01FA
/* WidgetViewModel.swift in Sources */
,
CD7D3182268F0C60000D01FA
/* OneWeatherUI+Global.swift in Sources */
,
CD7D3182268F0C60000D01FA
/* OneWeatherUI+Global.swift in Sources */
,
...
...
OneWeatherUI/OneWeatherUI/Widgets/Precipitation/MediumPrecipitationWidgetView.swift
View file @
b82c8b09
...
@@ -18,7 +18,7 @@ public struct MediumPrecipitationWidgetView: View {
...
@@ -18,7 +18,7 @@ public struct MediumPrecipitationWidgetView: View {
public
var
body
:
some
View
{
public
var
body
:
some
View
{
VStack
(
alignment
:
.
center
)
{
VStack
(
alignment
:
.
center
)
{
MediumWidgetTopView
(
widgetViewModel
:
widgetViewModel
)
WidgetTopView
(
widgetViewModel
:
widgetViewModel
,
style
:
.
medium
)
.
padding
(
.
top
,
12
)
.
padding
(
.
top
,
12
)
HStack
(
spacing
:
10
)
{
HStack
(
spacing
:
10
)
{
ForEach
(
0
..<
widgetViewModel
.
hourlyWeather
.
count
)
{
index
in
ForEach
(
0
..<
widgetViewModel
.
hourlyWeather
.
count
)
{
index
in
...
...
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/
Medium
WidgetTopView.swift
→
OneWeatherUI/OneWeatherUI/Widgets/SharedViews/WidgetTopView.swift
View file @
b82c8b09
//
//
//
Medium
WidgetTopView.swift
// WidgetTopView.swift
// OneWeatherUI
// OneWeatherUI
//
//
// Created by Dmitry Stepanets on 15.07.2021.
// Created by Dmitry Stepanets on 15.07.2021.
...
@@ -8,8 +8,15 @@
...
@@ -8,8 +8,15 @@
import
SwiftUI
import
SwiftUI
@available(iOS 14, *)
@available(iOS 14, *)
struct
MediumWidgetTopView
:
View
{
internal
enum
WidgetTopStyle
{
case
medium
case
large
}
@available(iOS 14, *)
struct
WidgetTopView
:
View
{
let
widgetViewModel
:
WidgetViewModel
let
widgetViewModel
:
WidgetViewModel
let
style
:
WidgetTopStyle
var
body
:
some
View
{
var
body
:
some
View
{
VStack
(
spacing
:
4
)
{
VStack
(
spacing
:
4
)
{
...
@@ -35,8 +42,13 @@ struct MediumWidgetTopView: View {
...
@@ -35,8 +42,13 @@ struct MediumWidgetTopView: View {
}
}
Spacer
()
Spacer
()
VStack
(
spacing
:
2
)
{
VStack
(
spacing
:
2
)
{
if
style
==
.
medium
{
CityNameView
(
cityName
:
widgetViewModel
.
cityName
,
CityNameView
(
cityName
:
widgetViewModel
.
cityName
,
isDeviceLocation
:
widgetViewModel
.
isDeviceLocation
)
isDeviceLocation
:
widgetViewModel
.
isDeviceLocation
)
}
else
{
Spacer
()
}
HighLowTemperatureView
(
highTemperature
:
widgetViewModel
.
highTemperature
,
HighLowTemperatureView
(
highTemperature
:
widgetViewModel
.
highTemperature
,
lowTemperature
:
widgetViewModel
.
lowTemperature
)
lowTemperature
:
widgetViewModel
.
lowTemperature
)
}
}
...
@@ -84,7 +96,7 @@ private struct Shadow: ViewModifier {
...
@@ -84,7 +96,7 @@ private struct Shadow: ViewModifier {
@available(iOS 14, *)
@available(iOS 14, *)
public
struct
MediumWidgetTopView_Preview
:
PreviewProvider
{
public
struct
MediumWidgetTopView_Preview
:
PreviewProvider
{
public
static
var
previews
:
some
View
{
public
static
var
previews
:
some
View
{
MediumWidgetTopView
(
widgetViewModel
:
WidgetViewModelMock
()
)
WidgetTopView
(
widgetViewModel
:
WidgetViewModelMock
(),
style
:
.
medium
)
.
previewDevice
(
"iPhone 11"
)
.
previewDevice
(
"iPhone 11"
)
.
preferredColorScheme
(
.
dark
)
.
preferredColorScheme
(
.
dark
)
.
background
(
WidgetColor
.
Name
(
"PrimaryBackground"
))
.
background
(
WidgetColor
.
Name
(
"PrimaryBackground"
))
...
...
OneWeatherUI/OneWeatherUI/Widgets/Temperature/LargeTemperatureWidgetView.swift
View file @
b82c8b09
...
@@ -25,40 +25,11 @@ public struct LargeTemperatureWidgetView: View {
...
@@ -25,40 +25,11 @@ public struct LargeTemperatureWidgetView: View {
CityNameView
(
cityName
:
widgetViewModel
.
cityName
,
CityNameView
(
cityName
:
widgetViewModel
.
cityName
,
isDeviceLocation
:
widgetViewModel
.
isDeviceLocation
)
isDeviceLocation
:
widgetViewModel
.
isDeviceLocation
)
.
padding
(
.
top
,
12
)
.
padding
(
.
top
,
12
)
HStack
{
WidgetTopView
(
widgetViewModel
:
widgetViewModel
,
HStack
(
spacing
:
8
)
{
style
:
.
large
)
Text
(
widgetViewModel
.
temperature
)
.
padding
(
.
top
,
4
)
.
font
(
WidgetFont
.
SFProDisplay
.
light
(
size
:
32
)
.
font
)
.
foregroundColor
(
WidgetColor
.
Name
(
"PrimaryTextColor"
))
Divider
()
.
padding
(
.
top
,
8
)
.
padding
(
.
bottom
,
8
)
Text
(
widgetViewModel
.
weatherType
)
.
font
(
WidgetFont
.
SFProDisplay
.
regular
(
size
:
12
)
.
font
)
.
foregroundColor
(
WidgetColor
.
Name
(
"PrimaryTextColor"
))
.
lineLimit
(
2
)
weatherImage
(
uiImage
:
widgetViewModel
.
weatherIcon
)
.
aspectRatio
(
contentMode
:
.
fit
)
.
frame
(
width
:
30
,
height
:
30
,
alignment
:
.
center
)
.
shadow
(
for
:
colorScheme
)
.
padding
(
.
trailing
,
4
)
}
Spacer
()
VStack
{
Spacer
()
HighLowTemperatureView
(
highTemperature
:
widgetViewModel
.
highTemperature
,
lowTemperature
:
widgetViewModel
.
lowTemperature
)
}
.
frame
(
height
:
35
)
.
padding
(
.
bottom
,
8
)
}
.
padding
(
.
top
,
10
)
.
frame
(
height
:
35
)
HourlyTemperatureView
(
hourlyWeather
:
widgetViewModel
.
hourlyWeather
)
HourlyTemperatureView
(
hourlyWeather
:
widgetViewModel
.
hourlyWeather
)
.
padding
(
.
top
,
16
)
HStack
{
HStack
{
Text
(
"Next few Days"
)
Text
(
"Next few Days"
)
...
@@ -72,19 +43,20 @@ public struct LargeTemperatureWidgetView: View {
...
@@ -72,19 +43,20 @@ public struct LargeTemperatureWidgetView: View {
.
padding
(
.
top
,
17
)
.
padding
(
.
top
,
17
)
VStack
{
VStack
{
ForEach
(
0
..<
4
)
{
index
in
ForEach
(
0
..<
min
(
4
,
widgetViewModel
.
dailyWather
.
count
))
{
index
in
let
daily
=
widgetViewModel
.
dailyWather
[
index
]
HStack
{
HStack
{
Text
(
"6, Tuesday"
)
Text
(
daily
.
dateString
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
Spacer
()
Spacer
()
weatherDayImage
(
uiImage
:
widgetViewModel
.
weatherIcon
)
weatherDayImage
(
uiImage
:
daily
.
weatherIcon
)
Spacer
()
Spacer
()
.
frame
(
width
:
52
)
.
frame
(
width
:
52
)
Text
(
"75°"
)
Text
(
daily
.
minTemp
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
Spacer
()
Spacer
()
.
frame
(
width
:
52
)
.
frame
(
width
:
52
)
Text
(
"81°"
)
Text
(
daily
.
maxTemp
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
.
font
(
WidgetFont
.
SFProDisplay
.
thin
(
size
:
14
)
.
font
)
Spacer
()
Spacer
()
.
frame
(
width
:
28
)
.
frame
(
width
:
28
)
...
@@ -92,6 +64,7 @@ public struct LargeTemperatureWidgetView: View {
...
@@ -92,6 +64,7 @@ public struct LargeTemperatureWidgetView: View {
}
}
}
}
.
padding
([
.
top
,
.
bottom
],
20
)
.
padding
([
.
top
,
.
bottom
],
20
)
}
}
.
padding
([
.
leading
,
.
trailing
],
10
)
.
padding
([
.
leading
,
.
trailing
],
10
)
.
background
(
WidgetColor
.
Name
(
"PrimaryBackground"
))
.
background
(
WidgetColor
.
Name
(
"PrimaryBackground"
))
...
...
OneWeatherUI/OneWeatherUI/Widgets/Temperature/MediumTemperatureWidgetView.swift
View file @
b82c8b09
...
@@ -20,7 +20,7 @@ public struct MediumTemperatureWidgetView: View {
...
@@ -20,7 +20,7 @@ public struct MediumTemperatureWidgetView: View {
public
var
body
:
some
View
{
public
var
body
:
some
View
{
VStack
(
alignment
:
.
leading
)
{
VStack
(
alignment
:
.
leading
)
{
MediumWidgetTopView
(
widgetViewModel
:
widgetViewModel
)
WidgetTopView
(
widgetViewModel
:
widgetViewModel
,
style
:
.
medium
)
.
padding
(
.
top
,
10
)
.
padding
(
.
top
,
10
)
HourlyTemperatureView
(
hourlyWeather
:
widgetViewModel
.
hourlyWeather
)
HourlyTemperatureView
(
hourlyWeather
:
widgetViewModel
.
hourlyWeather
)
.
padding
(
.
bottom
,
10
)
.
padding
(
.
bottom
,
10
)
...
...
OneWeatherUI/OneWeatherUI/Widgets/ViewModels/WidgetViewModel.swift
View file @
b82c8b09
...
@@ -34,18 +34,18 @@ public struct WidgetHourlyWeather {
...
@@ -34,18 +34,18 @@ public struct WidgetHourlyWeather {
@available(iOS 14, *)
@available(iOS 14, *)
public
struct
WidgetDailyWeather
{
public
struct
WidgetDailyWeather
{
let
date
:
Date
let
dateString
:
String
let
weekDay
:
String
let
isToday
:
Bool
let
isToday
:
Bool
let
minTemp
:
String
let
minTemp
:
String
let
maxTemp
:
String
let
maxTemp
:
String
let
weatherIcon
:
UIImage
public
init
(
date
:
Date
,
weekDay
:
String
,
isToday
:
Bool
,
minTemp
:
String
,
maxTemp
:
String
)
{
public
init
(
dateString
:
String
,
isToday
:
Bool
,
minTemp
:
String
,
maxTemp
:
String
,
weatherIcon
:
UIImage
)
{
self
.
date
=
date
self
.
dateString
=
dateString
self
.
weekDay
=
weekDay
self
.
isToday
=
isToday
self
.
isToday
=
isToday
self
.
minTemp
=
minTemp
self
.
minTemp
=
minTemp
self
.
maxTemp
=
maxTemp
self
.
maxTemp
=
maxTemp
self
.
weatherIcon
=
weatherIcon
}
}
}
}
...
...
OneWeatherUI/OneWeatherUI/Widgets/ViewModels/WidgetViewModelMock.swift
View file @
b82c8b09
...
@@ -41,11 +41,13 @@ struct WidgetViewModelMock: WidgetViewModel {
...
@@ -41,11 +41,13 @@ struct WidgetViewModelMock: WidgetViewModel {
let
dailyWather
:
[
WidgetDailyWeather
]
=
{
let
dailyWather
:
[
WidgetDailyWeather
]
=
{
var
array
=
[
WidgetDailyWeather
]()
var
array
=
[
WidgetDailyWeather
]()
for
index
in
0
..<
4
{
for
index
in
0
..<
4
{
let
daily
=
WidgetDailyWeather
(
date
:
Date
(),
let
daily
=
WidgetDailyWeather
(
dateString
:
"19, Monday"
,
weekDay
:
"Tuesday"
,
isToday
:
false
,
isToday
:
false
,
minTemp
:
"
\(
10
+
2
*
index
)
°"
,
minTemp
:
"
\(
10
+
2
*
index
)
°"
,
maxTemp
:
"
\(
22
+
2
*
index
)
°"
)
maxTemp
:
"
\(
22
+
2
*
index
)
°"
,
weatherIcon
:
UIImage
(
named
:
"partlyCloudyDay"
,
in
:
OneWeatherUI
.
frameworkBundle
,
compatibleWith
:
nil
)
??
UIImage
())
array
.
append
(
daily
)
array
.
append
(
daily
)
}
}
return
array
return
array
...
...
OneWeatherWidget/Data/WeatherEntry.swift
View file @
b82c8b09
...
@@ -37,6 +37,19 @@ struct WeatherEntry: TimelineEntry {
...
@@ -37,6 +37,19 @@ struct WeatherEntry: TimelineEntry {
func
generateDaily
()
->
[
DailyWeather
]
{
func
generateDaily
()
->
[
DailyWeather
]
{
var
array
=
[
DailyWeather
]()
var
array
=
[
DailyWeather
]()
let
daily
=
DailyWeather
(
lastTimeUpdated
:
Date
(),
date
:
Date
(),
timeZone
:
.
current
,
weekDay
:
.
monday
)
array
.
append
(
daily
)
// for index in 0..<4 {
// let daily = DailyWeather(lastTimeUpdated: Date(),
// date: Date(),
// timeZone: TimeZone(abbreviation: "PST")!,
// weekDay: .monday,
// type: .partlyCloudy,
// minTemp: .init(value: 69, unit: .fahrenheit),
// maxTemp: .init(value: 75, unit: .fahrenheit))
// array.append(daily)
// }
return
array
return
array
}
}
...
...
OneWeatherWidget/UI/WidgetPlaceholderView.swift
View file @
b82c8b09
...
@@ -33,6 +33,6 @@ struct WidgetPlaceholderView: View {
...
@@ -33,6 +33,6 @@ struct WidgetPlaceholderView: View {
struct
WidgetPlaceholderView_Preview
:
PreviewProvider
{
struct
WidgetPlaceholderView_Preview
:
PreviewProvider
{
static
var
previews
:
some
View
{
static
var
previews
:
some
View
{
WidgetPlaceholderView
()
WidgetPlaceholderView
()
.
previewContext
(
WidgetPreviewContext
(
family
:
.
system
Small
))
.
previewContext
(
WidgetPreviewContext
(
family
:
.
system
Large
))
}
}
}
}
OneWeatherWidget/ViewModels/ForecastWidgetViewModel.swift
View file @
b82c8b09
...
@@ -16,13 +16,25 @@ private struct Formatter {
...
@@ -16,13 +16,25 @@ private struct Formatter {
return
formatter
return
formatter
}()
}()
private
static
var
largeFmt
:
DateFormatter
=
{
let
formatter
=
DateFormatter
()
formatter
.
dateFormat
=
"d, EEEE"
return
formatter
}()
static
func
set
(
timeZone
:
TimeZone
)
{
static
func
set
(
timeZone
:
TimeZone
)
{
fmt
.
timeZone
=
timeZone
fmt
.
timeZone
=
timeZone
largeFmt
.
timeZone
=
timeZone
}
}
static
func
dateString
(
date
:
Date
)
->
String
{
static
func
dateString
(
date
:
Date
)
->
String
{
return
fmt
.
string
(
from
:
date
)
return
fmt
.
string
(
from
:
date
)
}
}
static
func
largeDateString
(
date
:
Date
)
->
String
{
return
largeFmt
.
string
(
from
:
date
)
}
}
}
struct
ForecastWidgetViewModel
:
WidgetViewModel
{
struct
ForecastWidgetViewModel
:
WidgetViewModel
{
...
@@ -68,12 +80,12 @@ struct ForecastWidgetViewModel: WidgetViewModel {
...
@@ -68,12 +80,12 @@ struct ForecastWidgetViewModel: WidgetViewModel {
for
index
in
0
..<
min
(
modelDaily
.
count
,
4
)
{
for
index
in
0
..<
min
(
modelDaily
.
count
,
4
)
{
let
daily
=
modelDaily
[
index
]
let
daily
=
modelDaily
[
index
]
let
dailyHourly
=
WidgetDailyWeather
(
date
:
daily
.
date
,
let
widgetDaily
=
WidgetDailyWeather
(
dateString
:
Formatter
.
largeDateString
(
date
:
daily
.
date
),
weekDay
:
daily
.
weekDay
.
rawValue
,
isToday
:
daily
.
isToday
,
isToday
:
daily
.
isToday
,
minTemp
:
daily
.
minTemp
?
.
settingsConverted
.
shortString
??
""
,
minTemp
:
daily
.
minTemp
?
.
settingsConverted
.
shortString
??
""
,
maxTemp
:
daily
.
maxTemp
?
.
settingsConverted
.
shortString
??
""
)
maxTemp
:
daily
.
maxTemp
?
.
settingsConverted
.
shortString
??
""
,
array
.
append
(
dailyHourly
)
weatherIcon
:
daily
.
type
.
image
(
isDay
:
true
))
array
.
append
(
widgetDaily
)
}
}
return
array
return
array
}
}
...
...
OneWeatherWidget/Widgets/TemperatureWidget.swift
View file @
b82c8b09
...
@@ -23,7 +23,7 @@ struct TemperatureWidget: Widget {
...
@@ -23,7 +23,7 @@ struct TemperatureWidget: Widget {
}
}
.
configurationDisplayName
(
"widget.temperature.title"
.
localized
())
.
configurationDisplayName
(
"widget.temperature.title"
.
localized
())
.
description
(
"widget.temperature.description"
.
localized
())
.
description
(
"widget.temperature.description"
.
localized
())
.
supportedFamilies
([
.
systemSmall
,
.
systemMedium
])
.
supportedFamilies
([
.
systemSmall
,
.
systemMedium
,
.
systemLarge
])
}
}
}
}
...
@@ -53,7 +53,7 @@ struct WidgetView_Preview: PreviewProvider {
...
@@ -53,7 +53,7 @@ struct WidgetView_Preview: PreviewProvider {
date
:
Date
()))
date
:
Date
()))
.
preferredColorScheme
(
.
dark
)
.
preferredColorScheme
(
.
dark
)
.
previewDevice
(
"iPhone 11"
)
.
previewDevice
(
"iPhone 11"
)
.
previewContext
(
WidgetPreviewContext
(
family
:
.
system
Medium
))
.
previewContext
(
WidgetPreviewContext
(
family
:
.
system
Large
))
}
}
}
}
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