OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_EXPANDABLE_ITEM_H_ | |
6 #define IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_EXPANDABLE_ITEM_H_ | |
7 | |
8 #import "ios/third_party/material_components_ios/src/components/CollectionCells/ src/MaterialCollectionCells.h" | |
9 | |
10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
11 | |
12 @class SuggestionsExpandableCell; | |
13 | |
14 @protocol SuggestionsExpandableCellAudience | |
15 | |
16 - (void)expandCell:(UICollectionViewCell*)cell; | |
17 - (void)retractCell:(UICollectionViewCell*)cell; | |
18 | |
19 @end | |
20 | |
21 // Item for an expandable article in the suggestions. An expandable article can | |
22 // be expanded, displaying more informations/interactions. | |
23 @interface SuggestionsExpandableItem : CollectionViewItem | |
24 | |
25 // Init the article with a |title|, a |subtitle| an |image| and some |detail| | |
26 // displayed only when the article is expanded. |type| is the type of the item. | |
27 - (instancetype)initWithType:(NSInteger)type | |
28 title:(NSString*)title | |
29 subtitle:(NSString*)subtitle | |
30 image:(UIImage*)image | |
31 detailText:(NSString*)detail NS_DESIGNATED_INITIALIZER; | |
32 | |
33 - (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE; | |
34 | |
35 @property(nonatomic, weak) id<SuggestionsExpandableCellAudience> audience; | |
36 | |
37 - (void)expand:(SuggestionsExpandableCell*)cell; | |
lpromero
2017/01/13 17:35:48
A isExpanded property needs to appear in the inter
gambard
2017/01/16 09:50:39
Done.
| |
38 - (void)retract:(SuggestionsExpandableCell*)cell; | |
39 | |
40 @end | |
41 | |
42 // Corresponding cell of an expandable article. | |
43 @interface SuggestionsExpandableCell : MDCCollectionViewCell | |
44 | |
45 @property(nonatomic, weak) id<SuggestionsExpandableCellAudience> audience; | |
46 @property(nonatomic, readonly, strong) UILabel* titleLabel; | |
47 @property(nonatomic, readonly, strong) UILabel* subtitleLabel; | |
48 @property(nonatomic, readonly, strong) UILabel* detailLabel; | |
49 @property(nonatomic, strong) UIImageView* imageView; | |
50 | |
51 @end | |
52 | |
53 #endif // IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_EXPANDABLE_ITEM_H_ | |
OLD | NEW |