@@ -29,6 +29,7 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
29
29
static let shadowRadius : CGFloat = 4
30
30
static let shadowOffset = CGSize ( width: 0 , height: 2 )
31
31
static let shadowOpacity : Float = 1
32
+ static let thumbnailScreenshotHeight : CGFloat = 200
32
33
}
33
34
// MARK: - Properties
34
35
@@ -43,6 +44,7 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
43
44
}
44
45
45
46
private lazy var favicon : FaviconImageView = . build( )
47
+ private lazy var faviconContainer : UIView = . build( )
46
48
47
49
// MARK: - UI
48
50
@@ -53,6 +55,8 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
53
55
stackView. alignment = . fill
54
56
stackView. spacing = UX . tabViewFooterSpacing
55
57
stackView. backgroundColor = . clear
58
+ stackView. setContentCompressionResistancePriority ( . defaultHigh, for: . vertical)
59
+ stackView. setContentHuggingPriority ( . defaultHigh, for: . vertical)
56
60
}
57
61
58
62
private lazy var backgroundHolder : UIView = . build { view in
@@ -71,6 +75,8 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
71
75
label. font = FXFontStyles . Regular. footnote. scaledFont ( )
72
76
label. adjustsFontForContentSizeCategory = true
73
77
label. isAccessibilityElement = false
78
+ label. setContentCompressionResistancePriority ( . defaultHigh, for: . vertical)
79
+ label. setContentHuggingPriority ( . defaultHigh, for: . vertical)
74
80
}
75
81
76
82
private lazy var closeButton : UIButton = . build { button in
@@ -110,8 +116,9 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
110
116
contentView. addSubview ( backgroundHolder)
111
117
contentView. addSubview ( footerView)
112
118
113
- footerView. addArrangedSubview ( favicon )
119
+ footerView. addArrangedSubview ( faviconContainer )
114
120
footerView. addArrangedSubview ( titleText)
121
+ faviconContainer. addSubview ( favicon)
115
122
116
123
backgroundHolder. addSubviews ( screenshotView, smallFaviconView, closeButton)
117
124
@@ -263,16 +270,22 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
263
270
backgroundHolder. topAnchor. constraint ( equalTo: contentView. topAnchor) ,
264
271
backgroundHolder. leadingAnchor. constraint ( equalTo: contentView. leadingAnchor) ,
265
272
backgroundHolder. trailingAnchor. constraint ( equalTo: contentView. trailingAnchor) ,
266
- backgroundHolder. bottomAnchor. constraint ( equalTo: footerView. topAnchor,
267
- constant: - UX. tabViewFooterSpacing) ,
273
+ backgroundHolder. heightAnchor. constraint ( equalToConstant: UX . thumbnailScreenshotHeight) ,
268
274
275
+ footerView. topAnchor. constraint ( equalTo: backgroundHolder. bottomAnchor,
276
+ constant: UX . tabViewFooterSpacing) ,
269
277
footerView. leadingAnchor. constraint ( greaterThanOrEqualTo: contentView. leadingAnchor) ,
270
278
footerView. centerXAnchor. constraint ( equalTo: contentView. centerXAnchor) ,
271
279
footerView. bottomAnchor. constraint ( equalTo: contentView. bottomAnchor) ,
272
280
footerView. trailingAnchor. constraint ( lessThanOrEqualTo: contentView. trailingAnchor) ,
273
281
282
+ faviconContainer. topAnchor. constraint ( lessThanOrEqualTo: favicon. topAnchor) ,
283
+ faviconContainer. bottomAnchor. constraint ( greaterThanOrEqualTo: favicon. bottomAnchor) ,
284
+ faviconContainer. leadingAnchor. constraint ( equalTo: favicon. leadingAnchor) ,
285
+ faviconContainer. trailingAnchor. constraint ( equalTo: favicon. trailingAnchor) ,
274
286
favicon. heightAnchor. constraint ( equalToConstant: UX . faviconSize. height) ,
275
287
favicon. widthAnchor. constraint ( equalToConstant: UX . faviconSize. width) ,
288
+ favicon. centerYAnchor. constraint ( equalTo: titleText. centerYAnchor) ,
276
289
277
290
closeButton. heightAnchor. constraint ( equalToConstant: UX . closeButtonSize) ,
278
291
closeButton. widthAnchor. constraint ( equalToConstant: UX . closeButtonSize) ,
0 commit comments