Skip to content

Commit 79e18e8

Browse files
Update: Animation view dimensions to match the design
1 parent 5e1629d commit 79e18e8

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class JetpackFullscreenOverlayViewController: UIViewController {
7171

7272
configureNavigationBar()
7373
applyStyles()
74+
addConstraints()
7475
setupContent()
7576
setupColors()
7677
setupFonts()
@@ -106,6 +107,12 @@ class JetpackFullscreenOverlayViewController: UIViewController {
106107
switchButton.layer.cornerRadius = Metrics.switchButtonCornerRadius
107108
}
108109

110+
private func addConstraints() {
111+
let animationSize = animation?.size ?? .init(width: 1, height: 1)
112+
let ratio = animationSize.width / animationSize.height
113+
animationView.widthAnchor.constraint(equalTo: animationView.heightAnchor, multiplier: ratio).isActive = true
114+
}
115+
109116
private func setupContent() {
110117
animationView.animation = animation
111118
titleLabel.text = config.title

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,20 @@
3131
<rect key="frame" x="0.0" y="0.0" width="667" height="280"/>
3232
<subviews>
3333
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PbU-M0-J6O" userLabel="Scroll Content View">
34-
<rect key="frame" x="0.0" y="0.0" width="667" height="653.5"/>
34+
<rect key="frame" x="0.0" y="0.0" width="667" height="280"/>
3535
<subviews>
3636
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="TTg-Z6-h4X" userLabel="Content Stack View">
37-
<rect key="frame" x="30" y="0.0" width="607" height="653.5"/>
37+
<rect key="frame" x="30" y="3.5" width="607" height="273"/>
3838
<subviews>
3939
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bUe-f2-zzc" userLabel="Icon Super View">
40-
<rect key="frame" x="0.0" y="0.0" width="607" height="445.5"/>
40+
<rect key="frame" x="0.0" y="0.0" width="607" height="65"/>
4141
<subviews>
4242
<view contentMode="scaleToFill" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="100" translatesAutoresizingMaskIntoConstraints="NO" id="v3d-AD-Jsf" customClass="AnimationView" customModule="Lottie">
43-
<rect key="frame" x="0.0" y="0.0" width="120" height="445.5"/>
43+
<rect key="frame" x="0.0" y="0.0" width="120" height="65"/>
4444
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
45+
<constraints>
46+
<constraint firstAttribute="height" constant="65" id="j0D-cP-R17"/>
47+
</constraints>
4548
</view>
4649
</subviews>
4750
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -52,25 +55,25 @@
5255
</constraints>
5356
</view>
5457
<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">
55-
<rect key="frame" x="0.0" y="465.5" width="607" height="20.5"/>
58+
<rect key="frame" x="0.0" y="85" width="607" height="20.5"/>
5659
<fontDescription key="fontDescription" type="system" pointSize="17"/>
5760
<nil key="textColor"/>
5861
<nil key="highlightedColor"/>
5962
</label>
6063
<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">
61-
<rect key="frame" x="0.0" y="506" width="607" height="20.5"/>
64+
<rect key="frame" x="0.0" y="125.5" width="607" height="20.5"/>
6265
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6366
<nil key="textColor"/>
6467
<nil key="highlightedColor"/>
6568
</label>
6669
<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">
67-
<rect key="frame" x="0.0" y="546.5" width="607" height="20.5"/>
70+
<rect key="frame" x="0.0" y="166" width="607" height="20.5"/>
6871
<fontDescription key="fontDescription" type="system" pointSize="17"/>
6972
<nil key="textColor"/>
7073
<nil key="highlightedColor"/>
7174
</label>
7275
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0z9-x4-AgY" userLabel="Learn More Super View">
73-
<rect key="frame" x="0.0" y="587" width="607" height="66.5"/>
76+
<rect key="frame" x="0.0" y="206.5" width="607" height="66.5"/>
7477
<subviews>
7578
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="n55-iX-u43">
7679
<rect key="frame" x="0.0" y="0.0" width="128" height="66.5"/>

0 commit comments

Comments
 (0)