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
e68fcfc6
Commit
e68fcfc6
authored
Aug 12, 2021
by
Dmitriy Stepanets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started implementing custom progress
parent
a4f79190
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
2 deletions
+90
-2
1Weather.xcodeproj/project.pbxproj
+4
-0
1Weather/AppDelegate.swift
+10
-2
1Weather/UI/View controllers/Onboarding/InitialOnboarding/OnboardingPageControl.swift
+67
-0
1Weather/UI/View controllers/Onboarding/InitialOnboarding/OnboardingPageController.swift
+9
-0
No files found.
1Weather.xcodeproj/project.pbxproj
View file @
e68fcfc6
...
...
@@ -86,6 +86,7 @@
CD6761802625B0F50079D273
/* RadarLayerCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD67617F2625B0F50079D273
/* RadarLayerCell.swift */
;
};
CD6761842625B6A10079D273
/* RadarLayersCellFactory.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6761832625B6A10079D273
/* RadarLayersCellFactory.swift */
;
};
CD6761882625C3360079D273
/* RadarViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6761872625C3360079D273
/* RadarViewModel.swift */
;
};
CD6B2C8426C55F4600473B2D
/* OnboardingPageControl.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6B2C8326C55F4600473B2D
/* OnboardingPageControl.swift */
;
};
CD6B303B2572680C004B34B3
/* SelfSizingButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6B303A2572680C004B34B3
/* SelfSizingButton.swift */
;
};
CD6B303E25726960004B34B3
/* ThemeProtocol.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6B303D25726960004B34B3
/* ThemeProtocol.swift */
;
};
CD6B304325726AD1004B34B3
/* DefaultTheme.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CD6B304225726AD1004B34B3
/* DefaultTheme.swift */
;
};
...
...
@@ -343,6 +344,7 @@
CD67617F2625B0F50079D273
/* RadarLayerCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RadarLayerCell.swift
;
sourceTree
=
"<group>"
;
};
CD6761832625B6A10079D273
/* RadarLayersCellFactory.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RadarLayersCellFactory.swift
;
sourceTree
=
"<group>"
;
};
CD6761872625C3360079D273
/* RadarViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RadarViewModel.swift
;
sourceTree
=
"<group>"
;
};
CD6B2C8326C55F4600473B2D
/* OnboardingPageControl.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
OnboardingPageControl.swift
;
sourceTree
=
"<group>"
;
};
CD6B303A2572680C004B34B3
/* SelfSizingButton.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SelfSizingButton.swift
;
sourceTree
=
"<group>"
;
};
CD6B303D25726960004B34B3
/* ThemeProtocol.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ThemeProtocol.swift
;
sourceTree
=
"<group>"
;
};
CD6B304225726AD1004B34B3
/* DefaultTheme.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DefaultTheme.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1031,6 +1033,7 @@
children
=
(
CDC62C4426C13B9200156643
/* OnboardingPageController.swift */
,
CDC62C4626C13BE300156643
/* OnboardingContentController.swift */
,
CD6B2C8326C55F4600473B2D
/* OnboardingPageControl.swift */
,
);
path
=
InitialOnboarding
;
sourceTree
=
"<group>"
;
...
...
@@ -1737,6 +1740,7 @@
CD37D3F6260DF5BA002669D6
/* SettingsViewModel.swift in Sources */
,
CD17C5F625D15B4400EE884E
/* TodayViewController.swift in Sources */
,
CD86245E25E646350097F3FB
/* SunUvView.swift in Sources */
,
CD6B2C8426C55F4600473B2D
/* OnboardingPageControl.swift in Sources */
,
CD427D2A266F86C600B4350A
/* ShortsManager.swift in Sources */
,
CDF8F12D26208E7B00DB384A
/* MapCurrentTimeView.swift in Sources */
,
CE6F5F0C263C8B3D00973137
/* SmartTextProvider.swift in Sources */
,
...
...
1Weather/AppDelegate.swift
View file @
e68fcfc6
...
...
@@ -80,8 +80,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
FirebaseApp
.
configure
()
ConfigManager
.
shared
.
updateConfig
()
let
appCoordinator
=
AppCoordinator
(
window
:
self
.
window
!
)
appCoordinator
.
start
()
//App UI
#if DEBUG
window
?
.
rootViewController
=
OnboardingPageController
(
coordinator
:
AppCoordinator
(
window
:
self
.
window
!
))
window
?
.
makeKeyAndVisible
()
// let appCoordinator = AppCoordinator(window: self.window!)
// appCoordinator.start()
#else
fatalError
(
"Remove in release build"
)
#endif
ThemeManager
.
setBaseTheme
()
...
...
1Weather/UI/View controllers/Onboarding/InitialOnboarding/OnboardingPageControl.swift
0 → 100644
View file @
e68fcfc6
//
// OnboardingPageControl.swift
// 1Weather
//
// Created by Dmitry Stepanets on 12.08.2021.
//
import
UIKit
class
OnboardingPageControl
:
UIView
{
//Private
private
let
kSpacePerDot
:
CGFloat
=
10
private
let
kDotSize
:
CGSize
=
.
init
(
width
:
9
,
height
:
9
)
private
let
totalPagesCount
:
Int
private
let
indicator
=
CAShapeLayer
()
private
var
dots
=
[
CAShapeLayer
]()
init
(
totalPagesCount
:
Int
)
{
self
.
totalPagesCount
=
totalPagesCount
super
.
init
(
frame
:
.
zero
)
prepareDots
()
prepareIndicator
()
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
self
.
frame
.
size
.
width
=
CGFloat
(
totalPagesCount
)
*
kDotSize
.
width
+
kSpacePerDot
*
(
CGFloat
(
totalPagesCount
)
-
1
)
self
.
frame
.
size
.
height
=
kDotSize
.
height
//Dots
for
(
index
,
dot
)
in
dots
.
enumerated
()
{
let
cgIndex
=
CGFloat
(
index
)
let
space
=
index
==
0
?
0
:
kSpacePerDot
let
rect
=
CGRect
(
origin
:
.
init
(
x
:
cgIndex
*
(
kDotSize
.
width
+
space
),
y
:
0
),
size
:
kDotSize
)
dot
.
path
=
CGPath
(
ellipseIn
:
rect
,
transform
:
nil
)
print
(
"Dot- index:
\(
index
)
rect:
\(
rect
)
"
)
}
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
scroll
(
toPage
index
:
Int
,
progress
:
CGFloat
)
{
var
scrollProgress
=
max
(
0
,
progress
)
scrollProgress
=
min
(
progress
,
1
)
}
}
private
extension
OnboardingPageControl
{
func
prepareDots
()
{
for
_
in
0
..<
totalPagesCount
{
let
dot
=
CAShapeLayer
()
dot
.
fillColor
=
UIColor
.
blue
.
cgColor
layer
.
addSublayer
(
dot
)
dots
.
append
(
dot
)
}
}
func
prepareIndicator
()
{
indicator
.
fillColor
=
UIColor
.
red
.
cgColor
indicator
.
path
=
UIBezierPath
(
roundedRect
:
.
init
(
origin
:
.
zero
,
size
:
kDotSize
),
cornerRadius
:
kDotSize
.
height
/
2
)
.
cgPath
layer
.
addSublayer
(
indicator
)
}
}
1Weather/UI/View controllers/Onboarding/InitialOnboarding/OnboardingPageController.swift
View file @
e68fcfc6
...
...
@@ -72,6 +72,15 @@ class OnboardingPageController: UIPageViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
#if DEBUG
let
control
=
OnboardingPageControl
(
totalPagesCount
:
5
)
view
.
addSubview
(
control
)
control
.
frame
.
origin
.
x
=
100
control
.
frame
.
origin
.
y
=
80
#else
fatalError
(
"Remove in release"
)
#endif
prepareController
()
prepareCloseButton
()
preparePageControl
()
...
...
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