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

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

Issue 2764783006: Create CollectionViewTextCell (Closed)
Patch Set: Add comment 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..79086fd51fe2ee34f278c5e35b64413685b4d247 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,18 @@ const CGFloat kHorizontalImageFixedSize = 40;
@"Text cell with text that is so long it must truncate at some point";
lpromero 2017/03/22 15:51:47 This should not truncate anymore, right?
gambard 2017/03/23 09:41:29 It is truncating because it is the current behavio
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 "
+ @"truncate at some point.";
lpromero 2017/03/22 15:51:47 Why does it truncate? The point is to never trunca
gambard 2017/03/23 09:41:29 I have added an option in the item to change the n
+ [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 +373,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