| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | 10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" |
| 11 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" | 11 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" |
| 12 | 12 |
| 13 // PaymentsTextItem is the model class corresponding to PaymentsTextCell. | 13 // PaymentsTextItem is the model class corresponding to PaymentsTextCell. |
| 14 @interface PaymentsTextItem : CollectionViewItem | 14 @interface PaymentsTextItem : CollectionViewItem |
| 15 | 15 |
| 16 // The message to display. | 16 // The main text to display. |
| 17 @property(nonatomic, copy) NSString* text; | 17 @property(nonatomic, copy) NSString* text; |
| 18 | 18 |
| 19 // The secondary text to display. |
| 20 @property(nonatomic, copy) NSString* detailText; |
| 21 |
| 19 // The image to display. | 22 // The image to display. |
| 20 @property(nonatomic, strong) UIImage* image; | 23 @property(nonatomic, strong) UIImage* image; |
| 21 | 24 |
| 25 // The accessory type for the represented cell. |
| 26 @property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType; |
| 27 |
| 22 @end | 28 @end |
| 23 | 29 |
| 24 // PaymentsTextCell implements a MDCCollectionViewCell subclass containing | 30 // PaymentsTextCell implements a MDCCollectionViewCell subclass containing |
| 25 // a text label and an optional image. The label is laid out to fill the full | 31 // a main text label, a secondary text label and an optional image. The labels |
| 26 // width of the cell and is wrapped as needed to fit in the cell. The image is | 32 // are laid out to fill the full width of the cell and are wrapped as needed to |
| 27 // laid out on the leading edge of the cell. The text label is laid out on the | 33 // fit in the cell. The image is laid out on the leading edge of the cell. The |
| 28 // the trailing edge of the image, if one exists, or the leading edge of the | 34 // text labels are laid out on the the trailing edge of the image, if one |
| 29 // cell otherwise, up to the trailing edge of the cell. This is suitable for | 35 // exists, or the leading edge of the cell otherwise, up to the trailing edge of |
| 30 // displaying text that needs to wrap which may or may not feature an image. | 36 // the cell. |
| 31 @interface PaymentsTextCell : MDCCollectionViewCell | 37 @interface PaymentsTextCell : MDCCollectionViewCell |
| 32 | 38 |
| 33 // UILabel corresponding to |text| from the item. | 39 // UILabel corresponding to |text| from the item. |
| 34 @property(nonatomic, readonly, strong) UILabel* textLabel; | 40 @property(nonatomic, readonly, strong) UILabel* textLabel; |
| 35 | 41 |
| 42 // UILabel corresponding to |detailText| from the item. |
| 43 @property(nonatomic, readonly, strong) UILabel* detailTextLabel; |
| 44 |
| 36 // UIImageView corresponding to |image| from the item. | 45 // UIImageView corresponding to |image| from the item. |
| 37 @property(nonatomic, readonly, strong) UIImageView* imageView; | 46 @property(nonatomic, readonly, strong) UIImageView* imageView; |
| 38 | 47 |
| 39 @end | 48 @end |
| 40 | 49 |
| 41 #endif // IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ | 50 #endif // IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_TEXT_ITEM_H_ |
| OLD | NEW |