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

Unified Diff: ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm

Issue 2625693002: Suggestions UI - expandable item (Closed)
Patch Set: Add tests Created 3 years, 11 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/suggestions/suggestions_collection_updater.mm
diff --git a/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm b/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm
index 51814e358875aebf85abd3039197e6f38918baaf..2d35570d0699db91a9f7f60d51d1c38d1e37d672 100644
--- a/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm
+++ b/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm
@@ -4,9 +4,11 @@
#import "ios/chrome/browser/ui/suggestions/suggestions_collection_updater.h"
+#include "base/mac/foundation_util.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_controller.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/suggestions/suggestions_article_item.h"
+#import "ios/chrome/browser/ui/suggestions/suggestions_expandable_item.h"
#import "ios/chrome/browser/ui/suggestions/suggestions_item.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -48,6 +50,19 @@ typedef NS_ENUM(NSInteger, ItemType) {
@"spawn on multiple lines"
image:[UIImage imageNamed:@"distillation_success"]]
toSectionWithIdentifier:sectionIdentifier];
+ SuggestionsExpandableItem* expandableItem =
+ [[SuggestionsExpandableItem alloc]
+ initWithType:ItemTypeExpand
+ title:@"Title of an Expandable Article"
+ subtitle:@"This Article can be expanded to display "
+ @"addition information or interaction "
+ @"options"
+ image:[UIImage imageNamed:@"distillation_fail"]
+ detailText:@"Details shown only when the article is "
+ @"expanded. It can be displayed on "
+ @"multiple lines."];
+ expandableItem.collectionView = _collectionViewController.collectionView;
+ [model addItem:expandableItem toSectionWithIdentifier:sectionIdentifier];
sectionIdentifier++;
}
}

Powered by Google App Engine
This is Rietveld 408576698