Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cell.mm

Issue 2889573002: Fix the ContentSuggestionsCell reuse cleanup (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cel l.h" 5 #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_cel l.h"
6 6
7 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" 7 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
8 #import "ios/chrome/browser/ui/favicon/favicon_view.h" 8 #import "ios/chrome/browser/ui/favicon/favicon_view.h"
9 #import "ios/chrome/browser/ui/uikit_ui_util.h" 9 #import "ios/chrome/browser/ui/uikit_ui_util.h"
10 #import "ios/chrome/browser/ui/util/i18n_string.h" 10 #import "ios/chrome/browser/ui/util/i18n_string.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 self.imageTitleSpacing.constant = 0; 205 self.imageTitleSpacing.constant = 0;
206 self.imageSize.constant = 0; 206 self.imageSize.constant = 0;
207 self.imageContainer.hidden = YES; 207 self.imageContainer.hidden = YES;
208 } 208 }
209 _displayImage = displayImage; 209 _displayImage = displayImage;
210 } 210 }
211 211
212 #pragma mark - UICollectionViewCell 212 #pragma mark - UICollectionViewCell
213 213
214 - (void)prepareForReuse { 214 - (void)prepareForReuse {
215 self.contentImageView.hidden = YES; 215 self.titleLabel.text = nil;
216 [self setSubtitleText:nil];
217 self.displayImage = NO;
216 } 218 }
217 219
218 #pragma mark - UIView 220 #pragma mark - UIView
219 221
220 // Implements -layoutSubviews as per instructions in documentation for 222 // Implements -layoutSubviews as per instructions in documentation for
221 // +[MDCCollectionViewCell cr_preferredHeightForWidth:forItem:]. 223 // +[MDCCollectionViewCell cr_preferredHeightForWidth:forItem:].
222 - (void)layoutSubviews { 224 - (void)layoutSubviews {
223 [super layoutSubviews]; 225 [super layoutSubviews];
224 226
225 // Adjust the text label preferredMaxLayoutWidth when the parent's width 227 // Adjust the text label preferredMaxLayoutWidth when the parent's width
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 @"title" : _titleLabel, 320 @"title" : _titleLabel,
319 @"text" : _subtitleLabel, 321 @"text" : _subtitleLabel,
320 @"additional" : _additionalInformationLabel, 322 @"additional" : _additionalInformationLabel,
321 @"favicon" : _faviconView, 323 @"favicon" : _faviconView,
322 }, 324 },
323 @{ @"space" : @(kStandardSpacing), 325 @{ @"space" : @(kStandardSpacing),
324 @"small" : @(kSmallSpacing) }); 326 @"small" : @(kSmallSpacing) });
325 } 327 }
326 328
327 @end 329 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698