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
46752414
Commit
46752414
authored
Oct 06, 2021
by
Dmitry Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IOS-187]: Added swipe nudge view
[IOS-179]: Implemented the swipe nudge UI
parent
39aef5b9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
1 deletions
+102
-1
1Weather/Resources/Assets.xcassets/precip_swipe_nudge.imageset/Contents.json
+15
-0
1Weather/Resources/Assets.xcassets/precip_swipe_nudge.imageset/precip_swipe_nudge.pdf
+0
-0
1Weather/Resources/Assets.xcassets/temp_swipe_nudge.imageset/Contents.json
+15
-0
1Weather/Resources/Assets.xcassets/temp_swipe_nudge.imageset/temp_swipe_nudge.pdf
+0
-0
1Weather/Resources/en.lproj/Localizable.strings
+3
-0
1Weather/UI/SharedViews/MinutelyForecastView/MinutelyForecastView.swift
+68
-0
1Weather/UI/View controllers/Today/Shorts/ShortsCollectionViewCell.swift
+1
-1
No files found.
1Weather/Resources/Assets.xcassets/precip_swipe_nudge.imageset/Contents.json
0 → 100644
View file @
46752414
{
"images"
:
[
{
"filename"
:
"precip_swipe_nudge.pdf"
,
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
},
"properties"
:
{
"preserves-vector-representation"
:
true
}
}
1Weather/Resources/Assets.xcassets/precip_swipe_nudge.imageset/precip_swipe_nudge.pdf
0 → 100644
View file @
46752414
File added
1Weather/Resources/Assets.xcassets/temp_swipe_nudge.imageset/Contents.json
0 → 100644
View file @
46752414
{
"images"
:
[
{
"filename"
:
"temp_swipe_nudge.pdf"
,
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
},
"properties"
:
{
"preserves-vector-representation"
:
true
}
}
1Weather/Resources/Assets.xcassets/temp_swipe_nudge.imageset/temp_swipe_nudge.pdf
0 → 100644
View file @
46752414
File added
1Weather/Resources/en.lproj/Localizable.strings
View file @
46752414
...
...
@@ -356,3 +356,6 @@
"onboarding.alerts.subtitle" = "Get alerts about severe weather well-in-advance";
"onboarding.radar.title" = "Live doppler radar";
"onboarding.radar.subtitle" = "Our live radar gives you real-time weather updates with excellent accuracy";
//Minutele
"minutelty.swipeToSee" = "swipe to see\nmore";
1Weather/UI/SharedViews/MinutelyForecastView/MinutelyForecastView.swift
View file @
46752414
...
...
@@ -60,10 +60,61 @@ private class MinutelyLevelView: UIView {
}
}
private
class
SwipeNudgeView
:
UIView
{
private
let
imageView
=
UIImageView
()
private
let
label
=
UILabel
()
init
()
{
super
.
init
(
frame
:
.
zero
)
prepareViews
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
public
func
configure
(
type
:
MinutelyForecastType
)
{
switch
type
{
case
.
temperature
:
imageView
.
image
=
UIImage
(
named
:
"temp_swipe_nudge"
)
label
.
textColor
=
kTemperatureColors
[
0
]
case
.
precipitation
:
imageView
.
image
=
UIImage
(
named
:
"precip_swipe_nudge"
)
label
.
textColor
=
kPrecipitationColors
[
0
]
}
}
private
func
prepareViews
()
{
imageView
.
contentMode
=
.
scaleAspectFit
addSubview
(
imageView
)
label
.
font
=
AppFont
.
SFPro
.
regular
(
size
:
10
)
label
.
textAlignment
=
.
center
label
.
numberOfLines
=
0
label
.
text
=
"minutelty.swipeToSee"
.
localized
.
uppercased
()
addSubview
(
label
)
//Constraitns
imageView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
centerX
.
equalToSuperview
()
make
.
width
.
equalTo
(
36
)
make
.
height
.
equalTo
(
17
)
}
label
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
top
.
equalTo
(
imageView
.
snp
.
bottom
)
.
offset
(
8
)
make
.
bottom
.
equalToSuperview
()
}
}
}
class
MinutelyForecastView
:
UIView
{
//Private
private
let
kLevelWidth
=
3
private
let
detailsInfoView
=
MinutelyForecastDetailsView
()
private
let
swipeNudgeView
=
SwipeNudgeView
()
private
let
levelsStackView
=
UIStackView
()
private
let
verticalStackView
=
UIStackView
()
private
let
scrollView
=
UIScrollView
()
...
...
@@ -95,6 +146,7 @@ class MinutelyForecastView: UIView {
prepareCenterDashLine
()
prepareScrollView
()
prepareVerticalStackView
()
prepareNudgeView
()
}
...
...
@@ -136,6 +188,8 @@ class MinutelyForecastView: UIView {
self
.
location
=
location
self
.
forecastType
=
forecastType
self
.
dateFormatter
.
timeZone
=
location
.
timeZone
swipeNudgeView
.
configure
(
type
:
forecastType
)
swipeNudgeView
.
alpha
=
1
centerDashline
.
strokeColor
=
forecastType
==
.
temperature
?
kTemperatureColors
.
last
?
.
cgColor
:
kPrecipitationColors
.
last
?
.
cgColor
...
...
@@ -432,6 +486,14 @@ private extension MinutelyForecastView {
}
}
func
prepareNudgeView
()
{
addSubview
(
swipeNudgeView
)
swipeNudgeView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
scrollView
)
.
inset
(
40
)
make
.
centerY
.
equalTo
(
scrollView
)
}
}
func
prepareCenterDashLine
()
{
centerDashline
.
lineWidth
=
1
centerDashline
.
lineDashPattern
=
[
4
,
2
]
...
...
@@ -445,6 +507,12 @@ extension MinutelyForecastView: UIScrollViewDelegate {
if
scrollView
.
panGestureRecognizer
.
state
==
.
began
{
timer
?
.
invalidate
()
timer
=
nil
if
swipeNudgeView
.
alpha
==
1
{
UIView
.
animate
(
withDuration
:
0.3
)
{
self
.
swipeNudgeView
.
alpha
=
0
}
}
}
let
targetPointX
=
Double
(
scrollView
.
contentInset
.
left
+
scrollView
.
contentOffset
.
x
)
...
...
1Weather/UI/View controllers/Today/Shorts/ShortsCollectionViewCell.swift
View file @
46752414
...
...
@@ -29,7 +29,7 @@ class ShortsCollectionViewCell: UICollectionViewCell {
footerLabel
.
text
=
shortsItem
.
title
if
let
image
=
self
.
bestImageForCellSize
(
images
:
shortsItem
.
images
)
{
let
resizeOptions
=
ImageProcessors
.
Resize
(
size
:
self
.
bounds
.
size
,
crop
:
tru
e
)
let
resizeOptions
=
ImageProcessors
.
Resize
(
size
:
self
.
bounds
.
size
,
crop
:
fals
e
)
let
cornerRadius
=
ImageProcessors
.
RoundedCorners
(
radius
:
12
)
let
imageRequest
=
ImageRequest
(
url
:
image
.
url
,
processors
:
[
resizeOptions
,
cornerRadius
])
...
...
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