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
b2a14a06
Commit
b2a14a06
authored
Apr 26, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read / unread NWSAlertCell background color.
parent
564a6669
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
5 deletions
+88
-5
1Weather/Network/Notifications/Model/NWSAlert.swift
+2
-1
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_background_read.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_background_unread.colorset/Contents.json
+38
-0
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_primary_text.colorset/Contents.json
+4
-4
1Weather/UI/View controllers/Notifications/Cells/NWSAlertCell.swift
+6
-0
No files found.
1Weather/Network/Notifications/Model/NWSAlert.swift
View file @
b2a14a06
...
@@ -20,6 +20,7 @@ public struct NWSAlert: Codable, Equatable, Hashable {
...
@@ -20,6 +20,7 @@ public struct NWSAlert: Codable, Equatable, Hashable {
/// This property is set by NWSAlertManager after decoding the response.
/// This property is set by NWSAlertManager after decoding the response.
public
var
city
:
String
=
""
public
var
city
:
String
=
""
public
var
timeZone
:
TimeZone
!
public
var
timeZone
:
TimeZone
!
public
var
read
:
Bool
=
false
public
var
extendedInfo
:
NWSAlertExtendedInfo
?
public
var
extendedInfo
:
NWSAlertExtendedInfo
?
...
@@ -45,7 +46,7 @@ public struct NWSAlert: Codable, Equatable, Hashable {
...
@@ -45,7 +46,7 @@ public struct NWSAlert: Codable, Equatable, Hashable {
lhs
.
severityLevel
==
rhs
.
severityLevel
&&
lhs
.
severityLevel
==
rhs
.
severityLevel
&&
lhs
.
description
==
rhs
.
description
&&
lhs
.
description
==
rhs
.
description
&&
lhs
.
expires
==
rhs
.
expires
lhs
.
expires
==
rhs
.
expires
//
do not compare weatherMessage & city
//
only compare attributes that come from JSON.
}
}
public
func
hash
(
into
hasher
:
inout
Hasher
)
{
public
func
hash
(
into
hasher
:
inout
Hasher
)
{
...
...
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_background_read.colorset/Contents.json
0 → 100644
View file @
b2a14a06
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.967"
,
"green"
:
"0.933"
,
"red"
:
"0.927"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.103"
,
"green"
:
"0.090"
,
"red"
:
"0.091"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_background_unread.colorset/Contents.json
0 → 100644
View file @
b2a14a06
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"1.000"
,
"green"
:
"1.000"
,
"red"
:
"1.000"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"0.170"
,
"green"
:
"0.149"
,
"red"
:
"0.150"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
1Weather/Resources/OneWeatherColorsAsset.xcassets/notifications/notifications_primary_text.colorset/Contents.json
View file @
b2a14a06
...
@@ -20,12 +20,12 @@
...
@@ -20,12 +20,12 @@
}
}
],
],
"color"
:
{
"color"
:
{
"color-space"
:
"
display-p3
"
,
"color-space"
:
"
srgb
"
,
"components"
:
{
"components"
:
{
"alpha"
:
"1.000"
,
"alpha"
:
"1.000"
,
"blue"
:
"
0.400
"
,
"blue"
:
"
255
"
,
"green"
:
"
0.312
"
,
"green"
:
"
255
"
,
"red"
:
"
0.280
"
"red"
:
"
255
"
}
}
},
},
"idiom"
:
"universal"
"idiom"
:
"universal"
...
...
1Weather/UI/View controllers/Notifications/Cells/NWSAlertCell.swift
View file @
b2a14a06
...
@@ -22,6 +22,8 @@ class NWSAlertCell: UITableViewCell {
...
@@ -22,6 +22,8 @@ class NWSAlertCell: UITableViewCell {
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
self
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
self
.
contentView
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
prepareHeader
()
prepareHeader
()
prepareAlertTextLabel
()
prepareAlertTextLabel
()
prepareFooter
()
prepareFooter
()
...
@@ -58,6 +60,10 @@ class NWSAlertCell: UITableViewCell {
...
@@ -58,6 +60,10 @@ class NWSAlertCell: UITableViewCell {
public
func
configure
(
with
alert
:
NWSAlert
)
{
public
func
configure
(
with
alert
:
NWSAlert
)
{
self
.
alert
=
alert
self
.
alert
=
alert
let
backgroundColorName
=
alert
.
read
?
"notifications_background_read"
:
"notifications_background_unread"
self
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
self
.
contentView
.
backgroundColor
=
UIColor
(
named
:
backgroundColorName
)
if
alert
.
expired
{
if
alert
.
expired
{
headerActiveExpiredLabel
.
text
=
"notifications.nwsCell.expired"
.
localized
()
headerActiveExpiredLabel
.
text
=
"notifications.nwsCell.expired"
.
localized
()
headerActiveExpiredLabel
.
backgroundColor
=
UIColor
(
named
:
"nws_cell_expired"
)
headerActiveExpiredLabel
.
backgroundColor
=
UIColor
(
named
:
"nws_cell_expired"
)
...
...
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