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

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

Issue 2764783006: Create CollectionViewTextCell (Closed)
Patch Set: Address comments 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
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 191843020707d8f56299da6e783e83fa9b38a1ac..922311583cf5217d821f9ebc3cb637bd81a85209 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,
@@ -125,6 +126,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 =
@@ -360,6 +374,9 @@ const CGFloat kHorizontalImageFixedSize = 40;
case ItemTypeSwitchDynamicHeight:
case ItemTypeSwitchSync:
case ItemTypeAccountControlDynamicHeight:
+ case ItemTypeTextCheckmark:
+ case ItemTypeTextDetail:
+ case ItemTypeText:
case ItemTypeTextError:
case ItemTypeAutofillCVC:
case ItemTypeAutofillStatus:

Powered by Google App Engine
This is Rietveld 408576698