| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.h" | 5 #import "ios/chrome/browser/ui/bookmarks/cells/bookmark_parent_folder_item.h" |
| 6 | 6 |
| 7 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" | 7 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" |
| 8 #import "ios/chrome/browser/ui/icons/chrome_icon.h" | 8 #import "ios/chrome/browser/ui/icons/chrome_icon.h" |
| 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 9 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 10 #include "ios/chrome/grit/ios_strings.h" | 10 #include "ios/chrome/grit/ios_strings.h" |
| 11 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF
ontLoader.h" | 11 #import "ios/third_party/material_components_ios/src/components/Typography/src/M
aterialTypography.h" |
| 12 #include "ui/base/l10n/l10n_util_mac.h" | 12 #include "ui/base/l10n/l10n_util_mac.h" |
| 13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) | 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." | 15 #error "This file requires ARC support." |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 @interface BookmarkParentFolderCell () | 18 @interface BookmarkParentFolderCell () |
| 19 @property(nonatomic, readwrite, strong) UILabel* parentFolderNameLabel; | 19 @property(nonatomic, readwrite, strong) UILabel* parentFolderNameLabel; |
| 20 @property(nonatomic, strong) UILabel* decorationLabel; | 20 @property(nonatomic, strong) UILabel* decorationLabel; |
| 21 @end | 21 @end |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 self.isAccessibilityElement = YES; | 55 self.isAccessibilityElement = YES; |
| 56 self.accessibilityTraits |= UIAccessibilityTraitButton; | 56 self.accessibilityTraits |= UIAccessibilityTraitButton; |
| 57 | 57 |
| 58 const CGFloat kHorizontalPadding = 15; | 58 const CGFloat kHorizontalPadding = 15; |
| 59 const CGFloat kVerticalPadding = 8; | 59 const CGFloat kVerticalPadding = 8; |
| 60 const CGFloat kParentFolderLabelTopPadding = 7; | 60 const CGFloat kParentFolderLabelTopPadding = 7; |
| 61 | 61 |
| 62 _decorationLabel = [[UILabel alloc] init]; | 62 _decorationLabel = [[UILabel alloc] init]; |
| 63 _decorationLabel.translatesAutoresizingMaskIntoConstraints = NO; | 63 _decorationLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 64 _decorationLabel.text = l10n_util::GetNSString(IDS_IOS_BOOKMARK_GROUP_BUTTON); | 64 _decorationLabel.text = l10n_util::GetNSString(IDS_IOS_BOOKMARK_GROUP_BUTTON); |
| 65 _decorationLabel.font = | 65 _decorationLabel.font = [[MDCTypography fontLoader] regularFontOfSize:12]; |
| 66 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:12]; | |
| 67 _decorationLabel.textColor = bookmark_utils_ios::lightTextColor(); | 66 _decorationLabel.textColor = bookmark_utils_ios::lightTextColor(); |
| 68 [self.contentView addSubview:_decorationLabel]; | 67 [self.contentView addSubview:_decorationLabel]; |
| 69 | 68 |
| 70 _parentFolderNameLabel = [[UILabel alloc] init]; | 69 _parentFolderNameLabel = [[UILabel alloc] init]; |
| 71 _parentFolderNameLabel.translatesAutoresizingMaskIntoConstraints = NO; | 70 _parentFolderNameLabel.translatesAutoresizingMaskIntoConstraints = NO; |
| 72 _parentFolderNameLabel.font = | 71 _parentFolderNameLabel.font = |
| 73 [[MDFRobotoFontLoader sharedInstance] regularFontOfSize:16]; | 72 [[MDCTypography fontLoader] regularFontOfSize:16]; |
| 74 _parentFolderNameLabel.textColor = | 73 _parentFolderNameLabel.textColor = |
| 75 [UIColor colorWithWhite:33.0 / 255.0 alpha:1.0]; | 74 [UIColor colorWithWhite:33.0 / 255.0 alpha:1.0]; |
| 76 _parentFolderNameLabel.textAlignment = NSTextAlignmentNatural; | 75 _parentFolderNameLabel.textAlignment = NSTextAlignmentNatural; |
| 77 [self.contentView addSubview:_parentFolderNameLabel]; | 76 [self.contentView addSubview:_parentFolderNameLabel]; |
| 78 | 77 |
| 79 UIImageView* navigationChevronImage = [[UIImageView alloc] init]; | 78 UIImageView* navigationChevronImage = [[UIImageView alloc] init]; |
| 80 UIImage* image = TintImage([ChromeIcon chevronIcon], [UIColor grayColor]); | 79 UIImage* image = TintImage([ChromeIcon chevronIcon], [UIColor grayColor]); |
| 81 navigationChevronImage.image = image; | 80 navigationChevronImage.image = image; |
| 82 navigationChevronImage.translatesAutoresizingMaskIntoConstraints = NO; | 81 navigationChevronImage.translatesAutoresizingMaskIntoConstraints = NO; |
| 83 [self.contentView addSubview:navigationChevronImage]; | 82 [self.contentView addSubview:navigationChevronImage]; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 - (NSString*)accessibilityLabel { | 115 - (NSString*)accessibilityLabel { |
| 117 return self.parentFolderNameLabel.text; | 116 return self.parentFolderNameLabel.text; |
| 118 } | 117 } |
| 119 | 118 |
| 120 - (NSString*)accessibilityHint { | 119 - (NSString*)accessibilityHint { |
| 121 return l10n_util::GetNSString( | 120 return l10n_util::GetNSString( |
| 122 IDS_IOS_BOOKMARK_EDIT_PARENT_FOLDER_BUTTON_HINT); | 121 IDS_IOS_BOOKMARK_EDIT_PARENT_FOLDER_BUTTON_HINT); |
| 123 } | 122 } |
| 124 | 123 |
| 125 @end | 124 @end |
| OLD | NEW |