@@ -18,10 +18,15 @@ class JetpackPrologueViewController: UIViewController {
18
18
// Start color is the background color with no alpha because if we use clear it will fade to black
19
19
// instead of just disappearing
20
20
let startColor = JetpackPrologueStyleGuide . backgroundColor. withAlphaComponent ( 0 )
21
+ let midTopColor = JetpackPrologueStyleGuide . backgroundColor. withAlphaComponent ( 0.9 )
22
+ let midBottomColor = JetpackPrologueStyleGuide . backgroundColor. withAlphaComponent ( 0.2 )
21
23
let endColor = JetpackPrologueStyleGuide . backgroundColor
22
24
23
- gradientLayer. colors = [ startColor. cgColor, endColor. cgColor]
24
- gradientLayer. locations = [ 0.0 , 0.9 ]
25
+ gradientLayer. colors = FeatureFlag . newLandingScreen. enabled ?
26
+ [ endColor. cgColor, midTopColor. cgColor, midBottomColor. cgColor, startColor. cgColor] :
27
+ [ startColor. cgColor, endColor. cgColor]
28
+
29
+ gradientLayer. locations = FeatureFlag . newLandingScreen. enabled ? [ 0.0 , 0.2 , 0.5 , 1.0 ] : [ 0.0 , 0.9 ]
25
30
26
31
return gradientLayer
27
32
} ( )
@@ -30,20 +35,39 @@ class JetpackPrologueViewController: UIViewController {
30
35
super. viewDidLoad ( )
31
36
32
37
view. backgroundColor = JetpackPrologueStyleGuide . backgroundColor
33
- view. addSubview ( starFieldView)
38
+ if FeatureFlag . newLandingScreen. enabled {
39
+ let viewModel = JetpackPromptsViewModel ( )
40
+ let jetpackAnimatedView = UIView . embedSwiftUIView ( JetpackLandingScreenView ( viewModel: viewModel) )
41
+ view. addSubview ( jetpackAnimatedView)
42
+ view. pinSubviewToAllEdges ( jetpackAnimatedView)
43
+ } else {
44
+ view. addSubview ( starFieldView)
45
+ }
34
46
view. layer. addSublayer ( gradientLayer)
35
-
36
- titleLabel. text = NSLocalizedString ( " Site security and performance \n from your pocket " , comment: " Prologue title label, the \n force splits it into 2 lines. " )
37
- titleLabel. textColor = JetpackPrologueStyleGuide . Title. textColor
38
- titleLabel. font = JetpackPrologueStyleGuide . Title. font
39
-
47
+ if FeatureFlag . newLandingScreen. enabled {
48
+ stackView. isHidden = true
49
+ titleLabel. isHidden = true
50
+ let logoImageView = UIImageView ( image: UIImage ( named: " jetpack-logo " ) )
51
+ logoImageView. translatesAutoresizingMaskIntoConstraints = false
52
+ view. addSubview ( logoImageView)
53
+ NSLayoutConstraint . activate ( [
54
+ logoImageView. widthAnchor. constraint ( equalToConstant: 72 ) ,
55
+ logoImageView. heightAnchor. constraint ( equalTo: logoImageView. widthAnchor) ,
56
+ logoImageView. centerXAnchor. constraint ( equalTo: view. centerXAnchor) ,
57
+ logoImageView. topAnchor. constraint ( equalTo: view. topAnchor, constant: 72 )
58
+ ] )
59
+ } else {
60
+ titleLabel. text = NSLocalizedString ( " Site security and performance \n from your pocket " , comment: " Prologue title label, the \n force splits it into 2 lines. " )
61
+ titleLabel. textColor = JetpackPrologueStyleGuide . Title. textColor
62
+ titleLabel. font = JetpackPrologueStyleGuide . Title. font
63
+ }
40
64
// Move the layers to appear below everything else
41
- starFieldView . layer . zPosition = Constants . starLayerPosition
42
- gradientLayer . zPosition = Constants . gradientLayerPosition
43
-
44
- addParallax ( )
45
-
46
- updateLabel ( for : traitCollection )
65
+ if !FeatureFlag . newLandingScreen . enabled {
66
+ starFieldView . layer . zPosition = Constants . starLayerPosition
67
+ gradientLayer . zPosition = Constants . gradientLayerPosition
68
+ addParallax ( )
69
+ updateLabel ( for : traitCollection )
70
+ }
47
71
}
48
72
49
73
func updateLabel( for traitCollection: UITraitCollection ) {
@@ -56,14 +80,15 @@ class JetpackPrologueViewController: UIViewController {
56
80
57
81
override func traitCollectionDidChange( _ previousTraitCollection: UITraitCollection ? ) {
58
82
super. traitCollectionDidChange ( previousTraitCollection)
59
-
83
+ guard !FeatureFlag . newLandingScreen . enabled else { return }
60
84
updateLabel ( for: traitCollection)
61
85
}
62
86
63
87
override func viewDidLayoutSubviews( ) {
64
88
super. viewDidLayoutSubviews ( )
65
-
66
- starFieldView. frame = view. bounds
89
+ if !FeatureFlag. newLandingScreen. enabled {
90
+ starFieldView. frame = view. bounds
91
+ }
67
92
gradientLayer. frame = view. bounds
68
93
}
69
94
0 commit comments