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

Unified Diff: ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm

Issue 2764783006: Create CollectionViewTextCell (Closed)
Patch Set: Fix tests Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/collection_view/cells/collection_view_text_item_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
index f690fbfe28644e2449e0cdc3f08b8a52292509d4..167b22cf2d1b11716e8d64b664cd2a8e11a86fa7 100644
--- a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
@@ -59,6 +59,7 @@ typedef NS_ENUM(NSInteger, SectionIdentifier) {
typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeTextCheckmark = kItemTypeEnumZero,
ItemTypeTextDetail,
+ ItemTypeText,
ItemTypeTextError,
ItemTypeDetailBasic,
ItemTypeDetailLeftMedium,
@@ -128,6 +129,19 @@ const CGFloat kHorizontalImageFixedSize = 40;
@"Text cell with text that is so long it must truncate at some point";
textCell2.accessoryType = MDCCollectionViewCellAccessoryDetailButton;
[model addItem:textCell2 toSectionWithIdentifier:SectionIdentifierTextCell];
+ CollectionViewTextItem* textCell3 =
+ [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease];
+ textCell3.text = @"Truncated text cell with three lines:";
+ textCell3.detailText = @"One title line and two detail lines, so it should "
+ @"wrap nicely at some point.";
+ textCell3.numberOfDetailTextLines = 0;
+ [model addItem:textCell3 toSectionWithIdentifier:SectionIdentifierTextCell];
+ CollectionViewTextItem* smallTextCell =
+ [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease];
+ smallTextCell.text = @"Text cell with small font but height of 48.";
+ smallTextCell.textFont = [smallTextCell.textFont fontWithSize:8];
+ [model addItem:smallTextCell
+ toSectionWithIdentifier:SectionIdentifierTextCell];
// Text and Error cell.
TextAndErrorItem* textAndErrorItem =
@@ -344,6 +358,9 @@ const CGFloat kHorizontalImageFixedSize = 40;
case ItemTypeSwitchDynamicHeight:
case ItemTypeSwitchSync:
case ItemTypeAccountControlDynamicHeight:
+ case ItemTypeTextCheckmark:
+ case ItemTypeTextDetail:
+ case ItemTypeText:
case ItemTypeTextError:
case ItemTypeAutofillCVC:
case ItemTypeAutofillStatus:
« no previous file with comments | « ios/chrome/browser/ui/collection_view/cells/collection_view_text_item_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698