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
2cde5631
Commit
2cde5631
authored
Mar 30, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added TodayAlertCell UI
parent
be813357
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
2 deletions
+124
-2
1Weather-Icons.sketch
+0
-0
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
1Weather/Resources/Assets.xcassets/alert.imageset/Contents.json
+15
-0
1Weather/Resources/Assets.xcassets/alert.imageset/alert.pdf
+0
-0
1Weather/Resources/en.lproj/Localizable.strings
+1
-0
1Weather/UI/View controllers/Today/Cells/TodayAlertCell.swift
+106
-0
Pods/Pods.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
No files found.
1Weather-Icons.sketch
View file @
2cde5631
No preview for this file type
1Weather.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2cde5631
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<
k
e
y
>
1Weather.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
1Weather.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
>
5
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
6
<
/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
>
...
...
1Weather.xcworkspace/xcuserdata/dstepanets.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2cde5631
No preview for this file type
1Weather/Resources/Assets.xcassets/alert.imageset/Contents.json
0 → 100644
View file @
2cde5631
{
"images"
:
[
{
"filename"
:
"alert.pdf"
,
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
},
"properties"
:
{
"preserves-vector-representation"
:
true
}
}
1Weather/Resources/Assets.xcassets/alert.imageset/alert.pdf
0 → 100644
View file @
2cde5631
File added
1Weather/Resources/en.lproj/Localizable.strings
View file @
2cde5631
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
//General
//General
"general.close" = "close";
"general.close" = "close";
"general.more" = "more";
//Forecast
//Forecast
"forecast.sunny" = "Sunny";
"forecast.sunny" = "Sunny";
...
...
1Weather/UI/View controllers/Today/Cells/TodayAlertCell.swift
View file @
2cde5631
...
@@ -14,4 +14,110 @@ class TodayAlertCell: UITableViewCell {
...
@@ -14,4 +14,110 @@ class TodayAlertCell: UITableViewCell {
private
let
infoLabel
=
UILabel
()
private
let
infoLabel
=
UILabel
()
private
let
timeAgoLabel
=
UILabel
()
private
let
timeAgoLabel
=
UILabel
()
private
let
moreLabel
=
UILabel
()
private
let
moreLabel
=
UILabel
()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
prepareCell
()
prepareContainer
()
prepareImageView
()
prepareLabels
()
updateUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
override
func
traitCollectionDidChange
(
_
previousTraitCollection
:
UITraitCollection
?)
{
super
.
traitCollectionDidChange
(
previousTraitCollection
)
self
.
updateUI
()
}
private
func
updateUI
()
{
contentView
.
backgroundColor
=
ThemeManager
.
currentTheme
.
baseBackgroundColor
container
.
backgroundColor
=
ThemeManager
.
currentTheme
.
containerBackgroundColor
switch
interfaceStyle
{
case
.
light
:
infoLabel
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
timeAgoLabel
.
textColor
=
ThemeManager
.
currentTheme
.
secondaryTextColor
container
.
layer
.
shadowColor
=
UIColor
(
hex
:
0x020116
)
.
cgColor
container
.
layer
.
shadowOffset
=
.
init
(
width
:
0
,
height
:
10
)
container
.
layer
.
shadowRadius
=
20
container
.
layer
.
shadowOpacity
=
0.12
case
.
dark
:
infoLabel
.
textColor
=
ThemeManager
.
currentTheme
.
primaryTextColor
infoLabel
.
textColor
=
ThemeManager
.
currentTheme
.
primaryTextColor
container
.
layer
.
shadowColor
=
UIColor
.
black
.
cgColor
container
.
layer
.
shadowOffset
=
.
init
(
width
:
8
,
height
:
8
)
container
.
layer
.
shadowRadius
=
8
container
.
layer
.
shadowOpacity
=
1.0
}
}
}
//MARK:- Prepare
private
extension
TodayAlertCell
{
func
prepareCell
()
{
selectionStyle
=
.
none
}
func
prepareContainer
()
{
container
.
layer
.
cornerRadius
=
12
contentView
.
addSubview
(
container
)
container
.
snp
.
makeConstraints
{
(
make
)
in
make
.
edges
.
equalToSuperview
()
.
inset
(
18
)
}
}
func
prepareImageView
()
{
alertImageView
.
image
=
UIImage
(
named
:
"alert"
)
alertImageView
.
contentMode
=
.
scaleAspectFit
container
.
addSubview
(
alertImageView
)
alertImageView
.
snp
.
makeConstraints
{
(
make
)
in
make
.
width
.
height
.
equalTo
(
33
)
make
.
left
.
equalToSuperview
()
.
inset
(
8
)
make
.
top
.
bottom
.
equalToSuperview
()
.
inset
(
16
)
}
}
func
prepareLabels
()
{
infoLabel
.
numberOfLines
=
2
infoLabel
.
lineBreakMode
=
.
byWordWrapping
infoLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
16
)
infoLabel
.
text
=
"Frost Advisory and 2 more alerts"
container
.
addSubview
(
infoLabel
)
timeAgoLabel
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
14
)
timeAgoLabel
.
text
=
"5 mins ago"
timeAgoLabel
.
textAlignment
=
.
right
container
.
addSubview
(
timeAgoLabel
)
moreLabel
.
font
=
AppFont
.
SFPro
.
medium
(
size
:
14
)
moreLabel
.
textColor
=
UIColor
(
hex
:
0xff2e00
)
moreLabel
.
text
=
"general.more"
.
localized
()
.
uppercased
()
moreLabel
.
textAlignment
=
.
right
container
.
addSubview
(
moreLabel
)
//Constraints
timeAgoLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalToSuperview
()
.
inset
(
14
)
make
.
right
.
equalToSuperview
()
.
inset
(
18
)
}
infoLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
left
.
equalTo
(
alertImageView
.
snp
.
right
)
.
offset
(
18
)
make
.
top
.
equalToSuperview
()
.
inset
(
12
)
make
.
bottom
.
equalToSuperview
()
.
inset
(
12
)
make
.
right
.
equalTo
(
timeAgoLabel
.
snp
.
left
)
.
offset
(
-
18
)
}
moreLabel
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
equalTo
(
timeAgoLabel
.
snp
.
bottom
)
.
offset
(
6
)
make
.
right
.
equalToSuperview
()
.
inset
(
18
)
}
}
}
}
Pods/Pods.xcodeproj/xcuserdata/dstepanets.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2cde5631
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<
k
e
y
>
XMLCoder.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
XMLCoder.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
>
6
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
5
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
SuppressBuildableAutocreation
<
/k
e
y
>
<
k
e
y
>
SuppressBuildableAutocreation
<
/k
e
y
>
...
...
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