Skip to content

Commit 362ecc4

Browse files
Merge pull request #19652 from wordpress-mobile/task/19649-overlay-large-text
Jetpack Focus: Correctly handle large text within the fullscreen overlay
2 parents f595ad1 + 0498782 commit 362ecc4

File tree

5 files changed

+21
-30
lines changed

5 files changed

+21
-30
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ struct JetpackFullscreenOverlayGeneralViewModel: JetpackFullscreenOverlayViewMod
160160
return source.rawValue
161161
}
162162

163-
var titleLabelMaxNumberOfLines: Int {
164-
return Constants.titleLabelMaxNumberOfLines
165-
}
166-
167163
var onDismiss: JetpackOverlayDismissCallback?
168164
}
169165

@@ -175,7 +171,6 @@ private extension JetpackFullscreenOverlayGeneralViewModel {
175171
static let readerLogoAnimationRtl = "JetpackReaderLogoAnimation_rtl"
176172
static let notificationsLogoAnimationLtr = "JetpackNotificationsLogoAnimation_ltr"
177173
static let notificationsLogoAnimationRtl = "JetpackNotificationsLogoAnimation_rtl"
178-
static let titleLabelMaxNumberOfLines: Int = 2
179174
}
180175

181176
enum Strings {

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ struct JetpackFullscreenOverlaySiteCreationViewModel: JetpackFullscreenOverlayVi
7171
return Constants.analyticsSource
7272
}
7373

74-
var titleLabelMaxNumberOfLines: Int {
75-
return Constants.titleLabelMaxNumberOfLines
76-
}
77-
7874
var onDismiss: JetpackOverlayDismissCallback?
7975
}
8076

@@ -83,7 +79,6 @@ private extension JetpackFullscreenOverlaySiteCreationViewModel {
8379
static let wpJetpackLogoAnimationLtr = "JetpackWordPressLogoAnimation_ltr"
8480
static let wpJetpackLogoAnimationRtl = "JetpackWordPressLogoAnimation_rtl"
8581
static let analyticsSource = "site_creation"
86-
static let titleLabelMaxNumberOfLines: Int = 3
8782
}
8883

8984
enum Strings {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class JetpackFullscreenOverlayViewController: UIViewController {
108108

109109
private func applyStyles() {
110110
switchButton.layer.cornerRadius = Metrics.switchButtonCornerRadius
111-
titleLabel.numberOfLines = viewModel.titleLabelMaxNumberOfLines
112111
}
113112

114113
private func setupConstraints() {
@@ -159,8 +158,11 @@ class JetpackFullscreenOverlayViewController: UIViewController {
159158

160159
private func setupFonts() {
161160
titleLabel.font = WPStyleGuide.fontForTextStyle(.largeTitle, fontWeight: .bold)
161+
titleLabel.adjustsFontForContentSizeCategory = true
162162
subtitleLabel.font = WPStyleGuide.fontForTextStyle(.body, fontWeight: .regular)
163+
subtitleLabel.adjustsFontForContentSizeCategory = true
163164
footnoteLabel.font = WPStyleGuide.fontForTextStyle(.body, fontWeight: .regular)
165+
footnoteLabel.adjustsFontForContentSizeCategory = true
164166
learnMoreButton.titleLabel?.font = WPStyleGuide.fontForTextStyle(.body, fontWeight: .regular)
165167
switchButton.titleLabel?.font = WPStyleGuide.fontForTextStyle(.body, fontWeight: .semibold)
166168
continueButton.titleLabel?.font = WPStyleGuide.fontForTextStyle(.body, fontWeight: .semibold)

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3030
<subviews>
3131
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qla-b8-9Ag">
32-
<rect key="frame" x="0.0" y="0.0" width="375" height="514"/>
32+
<rect key="frame" x="0.0" y="0.0" width="375" height="456"/>
3333
<subviews>
3434
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PbU-M0-J6O" userLabel="Scroll Content View">
35-
<rect key="frame" x="0.0" y="0.0" width="375" height="514"/>
35+
<rect key="frame" x="0.0" y="0.0" width="375" height="456"/>
3636
<subviews>
3737
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-Z6-h4X" userLabel="Content Stack View">
38-
<rect key="frame" x="30" y="115.66666666666666" width="315" height="282.66666666666674"/>
38+
<rect key="frame" x="29" y="86.5" width="317" height="283"/>
3939
<subviews>
4040
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bUe-f2-zzc" userLabel="Icon Super View">
41-
<rect key="frame" x="0.0" y="0.0" width="315" height="75"/>
41+
<rect key="frame" x="0.0" y="0.0" width="317" height="75"/>
4242
<subviews>
4343
<view contentMode="scaleToFill" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="100" translatesAutoresizingMaskIntoConstraints="NO" id="v3d-AD-Jsf" customClass="AnimationView" customModule="Lottie">
4444
<rect key="frame" x="0.0" y="0.0" width="120" height="65"/>
@@ -57,29 +57,29 @@
5757
</constraint>
5858
</constraints>
5959
</view>
60-
<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">
61-
<rect key="frame" x="0.0" y="94.999999999999986" width="315" height="20.333333333333329"/>
60+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.59999999999999998" translatesAutoresizingMaskIntoConstraints="NO" id="EqD-nO-Q6T">
61+
<rect key="frame" x="0.0" y="95" width="317" height="20.5"/>
6262
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6363
<nil key="textColor"/>
6464
<nil key="highlightedColor"/>
6565
</label>
6666
<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">
67-
<rect key="frame" x="0.0" y="135.33333333333331" width="315" height="20.333333333333343"/>
67+
<rect key="frame" x="0.0" y="135.5" width="317" height="20.5"/>
6868
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6969
<nil key="textColor"/>
7070
<nil key="highlightedColor"/>
7171
</label>
7272
<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">
73-
<rect key="frame" x="0.0" y="175.66666666666663" width="315" height="20.333333333333343"/>
73+
<rect key="frame" x="0.0" y="176" width="317" height="20.5"/>
7474
<fontDescription key="fontDescription" type="system" pointSize="17"/>
7575
<nil key="textColor"/>
7676
<nil key="highlightedColor"/>
7777
</label>
7878
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0z9-x4-AgY" userLabel="Learn More Super View">
79-
<rect key="frame" x="0.0" y="216" width="315" height="66.666666666666686"/>
79+
<rect key="frame" x="0.0" y="216.5" width="317" height="66.5"/>
8080
<subviews>
8181
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="n55-iX-u43">
82-
<rect key="frame" x="0.0" y="0.0" width="128" height="66.666666666666671"/>
82+
<rect key="frame" x="0.0" y="0.0" width="128" height="66.5"/>
8383
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
8484
<state key="normal" title="Learn More Button"/>
8585
<connections>
@@ -99,10 +99,10 @@
9999
</subviews>
100100
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
101101
<constraints>
102-
<constraint firstItem="TTg-Z6-h4X" firstAttribute="leading" secondItem="PbU-M0-J6O" secondAttribute="leading" constant="30" id="2d6-L5-bKl"/>
102+
<constraint firstItem="TTg-Z6-h4X" firstAttribute="leading" secondItem="PbU-M0-J6O" secondAttribute="leading" constant="29" id="2d6-L5-bKl"/>
103103
<constraint firstItem="TTg-Z6-h4X" firstAttribute="top" relation="greaterThanOrEqual" secondItem="PbU-M0-J6O" secondAttribute="top" id="2nW-cN-NOi"/>
104104
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="TTg-Z6-h4X" secondAttribute="bottom" id="FG3-Mq-Z5n"/>
105-
<constraint firstAttribute="trailing" secondItem="TTg-Z6-h4X" secondAttribute="trailing" constant="30" id="Q2G-S5-HVM"/>
105+
<constraint firstAttribute="trailing" secondItem="TTg-Z6-h4X" secondAttribute="trailing" constant="29" id="Q2G-S5-HVM"/>
106106
<constraint firstItem="TTg-Z6-h4X" firstAttribute="centerY" secondItem="PbU-M0-J6O" secondAttribute="centerY" id="WsY-Y2-V51"/>
107107
</constraints>
108108
</view>
@@ -117,13 +117,13 @@
117117
</constraints>
118118
</scrollView>
119119
<stackView opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="354" placeholderIntrinsicHeight="166" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="vcE-wc-fHe">
120-
<rect key="frame" x="10.666666666666657" y="529" width="354" height="108"/>
120+
<rect key="frame" x="10.5" y="471" width="354" height="166"/>
121121
<subviews>
122122
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VGE-FS-gsd">
123123
<rect key="frame" x="0.0" y="0.0" width="354" height="50"/>
124124
<constraints>
125125
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="354" id="93l-ng-h5B"/>
126-
<constraint firstAttribute="height" constant="50" id="DD0-7r-C5O">
126+
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="DD0-7r-C5O">
127127
<variation key="heightClass=compact-widthClass=regular" constant="44"/>
128128
</constraint>
129129
</constraints>
@@ -133,10 +133,10 @@
133133
<action selector="switchButtonPressed:" destination="-1" eventType="touchUpInside" id="Uk1-44-IEW"/>
134134
</connections>
135135
</button>
136-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hPW-8A-Di4">
137-
<rect key="frame" x="0.0" y="58" width="354" height="50"/>
136+
<button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="249" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hPW-8A-Di4">
137+
<rect key="frame" x="0.0" y="58" width="354" height="108"/>
138138
<constraints>
139-
<constraint firstAttribute="height" constant="50" id="cH2-GJ-f7z">
139+
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="cH2-GJ-f7z">
140140
<variation key="heightClass=compact-widthClass=regular" constant="44"/>
141141
</constraint>
142142
</constraints>
@@ -147,7 +147,7 @@
147147
</connections>
148148
</button>
149149
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="c3P-qm-yq7" userLabel="Horizontal Filler View">
150-
<rect key="frame" x="0.0" y="108" width="354" height="0.0"/>
150+
<rect key="frame" x="0.0" y="166" width="354" height="0.0"/>
151151
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
152152
<variation key="heightClass=compact" hidden="NO"/>
153153
</view>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ protocol JetpackFullscreenOverlayViewModel {
1414
var continueButtonText: String? { get }
1515
var shouldShowCloseButton: Bool { get }
1616
var analyticsSource: String { get }
17-
var titleLabelMaxNumberOfLines: Int { get }
1817
var onDismiss: JetpackOverlayDismissCallback? { get }
1918

2019
func trackOverlayDisplayed()

0 commit comments

Comments
 (0)