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 // Delegate for the SuggestionsExpandableCell. The delegate will take care of | |
15 // the expansion/retractation of the cell. | |
marq (ping after 24h)
2017/01/16 17:16:41
Perfer 'collapse' as the opposite to 'expand' inst
gambard
2017/01/17 09:59:00
Done.
| |
16 @protocol SuggestionsExpandableCellDelegate | |
17 | |
18 - (void)expandCell:(UICollectionViewCell*)cell; | |
19 - (void)retractCell:(UICollectionViewCell*)cell; | |
20 | |
21 @end | |
22 | |
23 // Item for an expandable article in the suggestions. An expandable article can | |
24 // be expanded, displaying more informations/interactions. | |
25 @interface SuggestionsExpandableItem : CollectionViewItem | |
26 | |
27 // Init the article with a |title|, a |subtitle| an |image| and some |detail| | |
28 // displayed only when the article is expanded. |type| is the type of the item. | |
marq (ping after 24h)
2017/01/16 17:16:41
Does |type| vary orthogonally to the expandable/no
gambard
2017/01/17 09:59:00
It is independent. All expandable items can have t
lpromero
2017/01/17 10:38:49
And in the other direction, the group of expandabl
| |
29 - (instancetype)initWithType:(NSInteger)type | |
30 title:(NSString*)title | |
31 subtitle:(NSString*)subtitle | |
32 image:(UIImage*)image | |
33 detailText:(NSString*)detail NS_DESIGNATED_INITIALIZER; | |
34 | |
35 - (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE; | |
36 | |
37 // Delegate for the configured cells. | |
marq (ping after 24h)
2017/01/16 17:16:41
each CollectionViewItem configures only a single c
gambard
2017/01/17 09:59:00
The item configure the cell for displaying on the
| |
38 @property(nonatomic, weak) id<SuggestionsExpandableCellDelegate> delegate; | |
39 | |
40 // Whether the cells should be in expanded mode. | |
41 @property(nonatomic) BOOL expanded; | |
42 | |
43 @end | |
44 | |
45 // Corresponding cell of an expandable article. | |
46 @interface SuggestionsExpandableCell : MDCCollectionViewCell | |
47 | |
48 @property(nonatomic, weak) id<SuggestionsExpandableCellDelegate> delegate; | |
49 @property(nonatomic, readonly, strong) UILabel* titleLabel; | |
50 @property(nonatomic, readonly, strong) UILabel* subtitleLabel; | |
51 @property(nonatomic, readonly, strong) UILabel* detailLabel; | |
52 @property(nonatomic, strong) UIImageView* imageView; | |
53 | |
54 - (void)expand; | |
55 - (void)retract; | |
56 | |
57 @end | |
58 | |
59 #endif // IOS_CHROME_BROWSER_UI_SUGGESTIONS_SUGGESTIONS_EXPANDABLE_ITEM_H_ | |
OLD | NEW |