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

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

Issue 2625693002: Suggestions UI - expandable item (Closed)
Patch Set: Rebase 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_data_source.mm
diff --git a/ios/chrome/browser/ui/suggestions/suggestions_data_source.mm b/ios/chrome/browser/ui/suggestions/suggestions_data_source.mm
index 31df618a150192f1faae3d9b3c66e168f16b4413..f79fc8ac55da536bff293340ceed357f2c0c0c28 100644
--- a/ios/chrome/browser/ui/suggestions/suggestions_data_source.mm
+++ b/ios/chrome/browser/ui/suggestions/suggestions_data_source.mm
@@ -4,9 +4,11 @@
#import "ios/chrome/browser/ui/suggestions/suggestions_data_source.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)
@@ -47,6 +49,17 @@ typedef NS_ENUM(NSInteger, ItemType) {
addObject:[[SuggestionsItem alloc] initWithType:ItemTypeText
title:@"The title"
subtitle:@"The subtitle"]];
+ [arrayToAdd
+ addObject:[[SuggestionsExpandableItem alloc]
+ initWithType:ItemTypeExpand
+ title:@"Title of an Expandable Article"
lpromero 2017/01/11 13:19:20 Can you add a bug to track removing these? I guess
gambard 2017/01/12 14:39:40 Well the bug for creating the suggestions UI shoul
+ 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."]];
[_items addObject:arrayToAdd];
}
}
@@ -67,6 +80,11 @@ typedef NS_ENUM(NSInteger, ItemType) {
for (NSMutableArray<CollectionViewItem*>* arrayWithItems in _items) {
[model addSectionWithIdentifier:sectionIdentifier];
for (CollectionViewItem* item in arrayWithItems) {
+ if ([item isKindOfClass:[SuggestionsExpandableItem class]]) {
+ SuggestionsExpandableItem* expandableItem =
+ base::mac::ObjCCastStrict<SuggestionsExpandableItem>(item);
+ expandableItem.collectionView = collectionViewController.collectionView;
+ }
[model addItem:item toSectionWithIdentifier:sectionIdentifier];
}
sectionIdentifier++;

Powered by Google App Engine
This is Rietveld 408576698