Skip to content

Commit 99ab0c8

Browse files
Update: increase bottom spacing when the continue button is hidden
1 parent 07fdda4 commit 99ab0c8

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class JetpackFullscreenOverlayViewController: UIViewController {
5252
@IBOutlet weak var learnMoreButton: UIButton!
5353
@IBOutlet weak var switchButton: UIButton!
5454
@IBOutlet weak var continueButton: UIButton!
55+
@IBOutlet weak var buttonsSuperViewBottomConstraint: NSLayoutConstraint!
5556

5657
// MARK: Initializers
5758

@@ -72,7 +73,7 @@ class JetpackFullscreenOverlayViewController: UIViewController {
7273
self.isModalInPresentation = true
7374
configureNavigationBar()
7475
applyStyles()
75-
addConstraints()
76+
setupConstraints()
7677
setupContent()
7778
setupColors()
7879
setupFonts()
@@ -110,10 +111,14 @@ class JetpackFullscreenOverlayViewController: UIViewController {
110111
titleLabel.numberOfLines = viewModel.titleLabelMaxNumberOfLines
111112
}
112113

113-
private func addConstraints() {
114+
private func setupConstraints() {
115+
// Animation constraint
114116
let animationSize = animation?.size ?? .init(width: 1, height: 1)
115117
let ratio = animationSize.width / animationSize.height
116118
animationView.widthAnchor.constraint(equalTo: animationView.heightAnchor, multiplier: ratio).isActive = true
119+
120+
// Buttons bottom constraints
121+
buttonsSuperViewBottomConstraint.constant = viewModel.continueButtonIsHidden ? Metrics.singleButtonBottomSpacing : Metrics.buttonsNormalBottomSpacing
117122
}
118123

119124
private func setupContent() {
@@ -252,6 +257,8 @@ private extension JetpackFullscreenOverlayViewController {
252257
static let switchButtonCornerRadius: CGFloat = 6
253258
static let titleLineHeightMultiple: CGFloat = 0.88
254259
static let titleKern: CGFloat = 0.37
260+
static let buttonsNormalBottomSpacing: CGFloat = 30
261+
static let singleButtonBottomSpacing: CGFloat = 60
255262
}
256263

257264
enum Constants {

WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="JetpackFullscreenOverlayViewController" customModule="WordPress" customModuleProvider="target">
1313
<connections>
1414
<outlet property="animationView" destination="v3d-AD-Jsf" id="8wg-bB-WH5"/>
15+
<outlet property="buttonsSuperViewBottomConstraint" destination="zhh-p2-mZx" id="4cZ-ra-9SF"/>
1516
<outlet property="contentStackView" destination="TTg-Z6-h4X" id="rbe-WF-3kb"/>
1617
<outlet property="continueButton" destination="hPW-8A-Di4" id="fym-yu-QBz"/>
1718
<outlet property="footnoteLabel" destination="1l4-qY-6ZA" id="Szg-6d-q2E"/>
@@ -34,7 +35,7 @@
3435
<rect key="frame" x="0.0" y="0.0" width="375" height="514"/>
3536
<subviews>
3637
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-Z6-h4X" userLabel="Content Stack View">
37-
<rect key="frame" x="30" y="115.5" width="315" height="283"/>
38+
<rect key="frame" x="30" y="115.66666666666666" width="315" height="282.66666666666674"/>
3839
<subviews>
3940
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bUe-f2-zzc" userLabel="Icon Super View">
4041
<rect key="frame" x="0.0" y="0.0" width="315" height="75"/>
@@ -57,28 +58,28 @@
5758
</constraints>
5859
</view>
5960
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.59999999999999998" translatesAutoresizingMaskIntoConstraints="NO" id="EqD-nO-Q6T">
60-
<rect key="frame" x="0.0" y="95" width="315" height="20.5"/>
61+
<rect key="frame" x="0.0" y="94.999999999999986" width="315" height="20.333333333333329"/>
6162
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6263
<nil key="textColor"/>
6364
<nil key="highlightedColor"/>
6465
</label>
6566
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtitle Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.59999999999999998" translatesAutoresizingMaskIntoConstraints="NO" id="n6H-KY-dMw">
66-
<rect key="frame" x="0.0" y="135.5" width="315" height="20.5"/>
67+
<rect key="frame" x="0.0" y="135.33333333333331" width="315" height="20.333333333333343"/>
6768
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6869
<nil key="textColor"/>
6970
<nil key="highlightedColor"/>
7071
</label>
7172
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Footnote Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.59999999999999998" translatesAutoresizingMaskIntoConstraints="NO" id="1l4-qY-6ZA">
72-
<rect key="frame" x="0.0" y="176" width="315" height="20.5"/>
73+
<rect key="frame" x="0.0" y="175.66666666666663" width="315" height="20.333333333333343"/>
7374
<fontDescription key="fontDescription" type="system" pointSize="17"/>
7475
<nil key="textColor"/>
7576
<nil key="highlightedColor"/>
7677
</label>
7778
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0z9-x4-AgY" userLabel="Learn More Super View">
78-
<rect key="frame" x="0.0" y="216.5" width="315" height="66.5"/>
79+
<rect key="frame" x="0.0" y="216" width="315" height="66.666666666666686"/>
7980
<subviews>
8081
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="n55-iX-u43">
81-
<rect key="frame" x="0.0" y="0.0" width="128" height="66.5"/>
82+
<rect key="frame" x="0.0" y="0.0" width="128" height="66.666666666666671"/>
8283
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
8384
<state key="normal" title="Learn More Button"/>
8485
<connections>
@@ -116,7 +117,7 @@
116117
</constraints>
117118
</scrollView>
118119
<stackView opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="354" placeholderIntrinsicHeight="166" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="vcE-wc-fHe">
119-
<rect key="frame" x="10.5" y="529" width="354" height="108"/>
120+
<rect key="frame" x="10.666666666666657" y="529" width="354" height="108"/>
120121
<subviews>
121122
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VGE-FS-gsd">
122123
<rect key="frame" x="0.0" y="0.0" width="354" height="50"/>

0 commit comments

Comments
 (0)