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

Unified Diff: ios/chrome/browser/payments/shipping_option_selection_view_controller.mm

Issue 2627323003: Expose font and color of the main and secondary texts in CollectionViewTextItem (Closed)
Patch Set: Addressed 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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
diff --git a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
index 65ca72208ab18ff7c7e35b9315a989190806d844..fa2bfbc249c2a2f4d898869cf99afe20ac88d949 100644
--- a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
+++ b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
@@ -101,6 +101,12 @@ typedef NS_ENUM(NSInteger, ItemType) {
item.detailText =
payment_request_utils::FormattedCurrencyString(value, currencyCode);
+ // Styling.
+ item.textFont = [MDCTypography body2Font];
+ item.textColor = [[MDCPalette greyPalette] tint900];
+ item.detailTextFont = [MDCTypography body1Font];
+ item.detailTextColor = [[MDCPalette greyPalette] tint900];
+
if (_selectedShippingOption == shippingOption) {
item.accessoryType = MDCCollectionViewCellAccessoryCheckmark;
_selectedItem = item;
@@ -122,27 +128,6 @@ typedef NS_ENUM(NSInteger, ItemType) {
UIEdgeInsetsMake(0, kSeparatorEdgeInset, 0, kSeparatorEdgeInset);
}
-#pragma mark UICollectionViewDataSource
-
-- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView
- cellForItemAtIndexPath:(nonnull NSIndexPath*)indexPath {
- UICollectionViewCell* cell =
- [super collectionView:collectionView cellForItemAtIndexPath:indexPath];
-
- NSInteger itemType =
- [self.collectionViewModel itemTypeForIndexPath:indexPath];
- DCHECK(ItemTypeShippingOption == itemType);
-
- MDCCollectionViewTextCell* textCell =
- base::mac::ObjCCastStrict<MDCCollectionViewTextCell>(cell);
- textCell.textLabel.font = [MDCTypography body2Font];
- textCell.textLabel.textColor = [[MDCPalette greyPalette] tint900];
- textCell.detailTextLabel.font = [MDCTypography body1Font];
- textCell.detailTextLabel.textColor = [[MDCPalette greyPalette] tint900];
-
- return cell;
-}
-
#pragma mark UICollectionViewDelegate
- (void)collectionView:(UICollectionView*)collectionView
« no previous file with comments | « no previous file | ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698