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

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

Issue 2625693002: Suggestions UI - expandable item (Closed)
Patch Set: Address comments 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..01c6d0cd2c87f411be194210e937b26f01e9b839 100644
--- a/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm
+++ b/ios/chrome/browser/ui/suggestions/suggestions_collection_updater.mm
@@ -4,10 +4,13 @@
#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"
+#import "ios/chrome/browser/ui/suggestions/suggestions_view_controller.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@@ -23,11 +26,11 @@ typedef NS_ENUM(NSInteger, ItemType) {
} // namespace
@implementation SuggestionsCollectionUpdater {
- CollectionViewController* _collectionViewController;
+ SuggestionsViewController* _collectionViewController;
}
- (instancetype)initWithCollectionViewController:
- (CollectionViewController*)collectionViewController {
+ (SuggestionsViewController*)collectionViewController {
self = [super init];
if (self) {
_collectionViewController = collectionViewController;
@@ -48,6 +51,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 "
+ @"additional 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.delegate = collectionViewController;
+ [model addItem:expandableItem toSectionWithIdentifier:sectionIdentifier];
sectionIdentifier++;
}
}

Powered by Google App Engine
This is Rietveld 408576698