Skip to content

Commit 443de8e

Browse files
authored
Merge pull request #17868 from wordpress-mobile/bug/checkmark-fading
Fix checkmark fading animation when choosing a site design
2 parents e3bd88c + a001683 commit 443de8e

3 files changed

Lines changed: 38 additions & 33 deletions

File tree

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* [*] Quick Start: Fixed a bug where a user logging in via a self-hosted site not connected to Jetpack would see Quick Start when selecting "No thanks" on the Quick Start prompt. [#17855]
1111
* [**] Threaded comments: comments can now be moderated via a drop-down menu on each comment. [#17888]
1212
* [*] Stats: Users can now add a new Insights card from the navigation bar. [#17867]
13+
* [*] Site creation: The checkbox that appears when choosing a design no longer flickers when toggled. [#17868]
1314

1415
19.1
1516
-----

WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/Collapsable Header Collection View Cell/CollapsableHeaderCollectionViewCell.swift

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CollapsableHeaderCollectionViewCell: UICollectionViewCell {
88
static let nib = UINib(nibName: "\(CollapsableHeaderCollectionViewCell.self)", bundle: Bundle.main)
99
static let selectionAnimationSpeed: Double = 0.25
1010
@IBOutlet weak var imageView: UIImageView!
11-
@IBOutlet weak var checkmarkBackground: UIView!
11+
@IBOutlet weak var checkmarkContainerView: UIView!
1212
@IBOutlet weak var checkmarkImageView: UIImageView! {
1313
didSet {
1414
checkmarkImageView.image = UIImage(systemName: "checkmark.circle.fill")
@@ -118,25 +118,20 @@ class CollapsableHeaderCollectionViewCell: UICollectionViewCell {
118118

119119
private func checkmarkHidden(_ isHidden: Bool, animated: Bool = false) {
120120
guard animated else {
121-
checkmarkImageView.isHidden = isHidden
122-
checkmarkBackground.isHidden = isHidden
121+
checkmarkContainerView.isHidden = isHidden
123122
return
124123
}
125124

126-
checkmarkImageView.isHidden = false
127-
checkmarkBackground.isHidden = false
125+
checkmarkContainerView.isHidden = false
128126

129127
// Set the inverse of the animation destination
130-
checkmarkImageView.alpha = isHidden ? 1 : 0
131-
checkmarkBackground.alpha = isHidden ? 1 : 0
128+
checkmarkContainerView.alpha = isHidden ? 1 : 0
132129
let targetAlpha: CGFloat = isHidden ? 0 : 1
133130

134131
UIView.animate(withDuration: CollapsableHeaderCollectionViewCell.selectionAnimationSpeed, animations: {
135-
self.checkmarkImageView.alpha = targetAlpha
136-
self.checkmarkBackground.alpha = targetAlpha
132+
self.checkmarkContainerView.alpha = targetAlpha
137133
}, completion: { (_) in
138-
self.checkmarkImageView.isHidden = !self.isSelected
139-
self.checkmarkBackground.isHidden = !self.isSelected
134+
self.checkmarkContainerView.isHidden = !self.isSelected
140135
})
141136
}
142137

WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/Collapsable Header Collection View Cell/CollapsableHeaderCollectionViewCell.xib

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -26,36 +26,45 @@
2626
</userDefinedRuntimeAttribute>
2727
</userDefinedRuntimeAttributes>
2828
</imageView>
29-
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="apQ-T8-du2">
30-
<rect key="frame" x="119" y="15" width="26" height="26"/>
31-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
32-
<userDefinedRuntimeAttributes>
33-
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
34-
<integer key="value" value="13"/>
35-
</userDefinedRuntimeAttribute>
36-
</userDefinedRuntimeAttributes>
37-
</view>
38-
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hx0-n7-XEA">
29+
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="laj-HC-L8x" userLabel="Checkmark Container View">
3930
<rect key="frame" x="116" y="12" width="32" height="32"/>
31+
<subviews>
32+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="apQ-T8-du2" userLabel="Checkmark Background View">
33+
<rect key="frame" x="3" y="3" width="26" height="26"/>
34+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
35+
<userDefinedRuntimeAttributes>
36+
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
37+
<integer key="value" value="13"/>
38+
</userDefinedRuntimeAttribute>
39+
</userDefinedRuntimeAttributes>
40+
</view>
41+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hx0-n7-XEA">
42+
<rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
43+
</imageView>
44+
</subviews>
4045
<constraints>
41-
<constraint firstAttribute="width" secondItem="hx0-n7-XEA" secondAttribute="height" multiplier="1:1" id="R5g-G9-uHa"/>
42-
<constraint firstAttribute="width" constant="32" id="qbg-FC-btk"/>
46+
<constraint firstItem="apQ-T8-du2" firstAttribute="bottom" secondItem="laj-HC-L8x" secondAttribute="bottom" constant="-3" id="4Oq-Oa-L56"/>
47+
<constraint firstItem="hx0-n7-XEA" firstAttribute="bottom" secondItem="laj-HC-L8x" secondAttribute="bottom" id="JwU-VE-hjG"/>
48+
<constraint firstItem="hx0-n7-XEA" firstAttribute="top" secondItem="laj-HC-L8x" secondAttribute="top" id="PJZ-WW-yRk"/>
49+
<constraint firstItem="apQ-T8-du2" firstAttribute="top" secondItem="laj-HC-L8x" secondAttribute="top" constant="3" id="SmU-ok-LgJ"/>
50+
<constraint firstItem="hx0-n7-XEA" firstAttribute="trailing" secondItem="laj-HC-L8x" secondAttribute="trailing" id="UeB-xi-zOK"/>
51+
<constraint firstAttribute="width" constant="32" id="ZRH-5B-0Ih"/>
52+
<constraint firstItem="apQ-T8-du2" firstAttribute="leading" secondItem="laj-HC-L8x" secondAttribute="leading" constant="3" id="ait-Ub-BdE"/>
53+
<constraint firstAttribute="width" secondItem="laj-HC-L8x" secondAttribute="height" multiplier="1:1" id="ijt-QC-a3J"/>
54+
<constraint firstItem="hx0-n7-XEA" firstAttribute="leading" secondItem="laj-HC-L8x" secondAttribute="leading" id="sJy-Qb-k7g"/>
55+
<constraint firstItem="apQ-T8-du2" firstAttribute="trailing" secondItem="laj-HC-L8x" secondAttribute="trailing" constant="-3" id="vg8-26-oiL"/>
4356
</constraints>
44-
</imageView>
57+
</view>
4558
</subviews>
4659
</view>
4760
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
4861
<constraints>
62+
<constraint firstItem="laj-HC-L8x" firstAttribute="top" secondItem="XpQ-DC-DLe" secondAttribute="top" constant="12" id="2MK-HP-5J7"/>
4963
<constraint firstItem="XpQ-DC-DLe" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="8aK-Nu-g20"/>
5064
<constraint firstAttribute="trailing" secondItem="XpQ-DC-DLe" secondAttribute="trailing" id="BrN-ay-15v"/>
51-
<constraint firstItem="apQ-T8-du2" firstAttribute="top" secondItem="hx0-n7-XEA" secondAttribute="top" constant="3" id="DMO-Ur-E0k"/>
65+
<constraint firstItem="laj-HC-L8x" firstAttribute="trailing" secondItem="XpQ-DC-DLe" secondAttribute="trailing" constant="-12" id="FUz-7V-mZ2"/>
5266
<constraint firstItem="XpQ-DC-DLe" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="Hly-4U-lPA"/>
53-
<constraint firstAttribute="trailing" secondItem="hx0-n7-XEA" secondAttribute="trailing" constant="12" id="OJx-TX-oHu"/>
54-
<constraint firstItem="apQ-T8-du2" firstAttribute="bottom" secondItem="hx0-n7-XEA" secondAttribute="bottom" constant="-3" id="Od3-sV-Hqg"/>
55-
<constraint firstItem="apQ-T8-du2" firstAttribute="leading" secondItem="hx0-n7-XEA" secondAttribute="leading" constant="3" id="Q9C-cP-3Ez"/>
5667
<constraint firstAttribute="bottom" secondItem="XpQ-DC-DLe" secondAttribute="bottom" id="juf-rq-F1x"/>
57-
<constraint firstItem="apQ-T8-du2" firstAttribute="trailing" secondItem="hx0-n7-XEA" secondAttribute="trailing" constant="-3" id="nxN-Kr-1fY"/>
58-
<constraint firstItem="hx0-n7-XEA" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="12" id="oc5-Cd-UNM"/>
5968
</constraints>
6069
<size key="customSize" width="191" height="244"/>
6170
<userDefinedRuntimeAttributes>
@@ -64,7 +73,7 @@
6473
</userDefinedRuntimeAttribute>
6574
</userDefinedRuntimeAttributes>
6675
<connections>
67-
<outlet property="checkmarkBackground" destination="apQ-T8-du2" id="FaX-4x-APs"/>
76+
<outlet property="checkmarkContainerView" destination="laj-HC-L8x" id="i9b-po-WdU"/>
6877
<outlet property="checkmarkImageView" destination="hx0-n7-XEA" id="Yst-6N-Qcg"/>
6978
<outlet property="imageView" destination="XpQ-DC-DLe" id="j69-db-QW7"/>
7079
</connections>

0 commit comments

Comments
 (0)