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

Side by Side Diff: ios/chrome/browser/ui/reading_list/number_badge_view.mm

Issue 2912863005: Use MDCTypography instead of MDFRobotoFontLoader directly. (Closed)
Patch Set: Tentative fix for ManualTextFramerTest Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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/reading_list/number_badge_view.h" 5 #import "ios/chrome/browser/ui/reading_list/number_badge_view.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #import "ios/chrome/common/material_timing.h" 10 #import "ios/chrome/common/material_timing.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 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc) 13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support." 14 #error "This file requires ARC support."
15 #endif 15 #endif
16 16
17 namespace { 17 namespace {
18 const CGFloat kAnimationDuration = ios::material::kDuration3; 18 const CGFloat kAnimationDuration = ios::material::kDuration3;
19 const CGFloat labelMargin = 2.5f; 19 const CGFloat labelMargin = 2.5f;
20 } // namespace 20 } // namespace
21 21
(...skipping 17 matching lines...) Expand all
39 if (self) { 39 if (self) {
40 self.backgroundColor = [UIColor clearColor]; 40 self.backgroundColor = [UIColor clearColor];
41 41
42 UIView* backgroundCircleView = [[UIView alloc] initWithFrame:CGRectZero]; 42 UIView* backgroundCircleView = [[UIView alloc] initWithFrame:CGRectZero];
43 _backgroundCircleView = backgroundCircleView; 43 _backgroundCircleView = backgroundCircleView;
44 [backgroundCircleView setTranslatesAutoresizingMaskIntoConstraints:NO]; 44 [backgroundCircleView setTranslatesAutoresizingMaskIntoConstraints:NO];
45 [self addSubview:backgroundCircleView]; 45 [self addSubview:backgroundCircleView];
46 46
47 UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; 47 UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero];
48 _label = label; 48 _label = label;
49 [label setFont:[[MDFRobotoFontLoader sharedInstance] boldFontOfSize:10]]; 49 [label setFont:[[MDCTypography fontLoader] boldFontOfSize:10]];
50 [label setTranslatesAutoresizingMaskIntoConstraints:NO]; 50 [label setTranslatesAutoresizingMaskIntoConstraints:NO];
51 [label setTextColor:[UIColor whiteColor]]; 51 [label setTextColor:[UIColor whiteColor]];
52 [self addSubview:label]; 52 [self addSubview:label];
53 53
54 [NSLayoutConstraint activateConstraints:@[ 54 [NSLayoutConstraint activateConstraints:@[
55 // Position bubble. 55 // Position bubble.
56 [backgroundCircleView.trailingAnchor 56 [backgroundCircleView.trailingAnchor
57 constraintEqualToAnchor:self.trailingAnchor], 57 constraintEqualToAnchor:self.trailingAnchor],
58 [backgroundCircleView.centerYAnchor 58 [backgroundCircleView.centerYAnchor
59 constraintEqualToAnchor:self.centerYAnchor], 59 constraintEqualToAnchor:self.centerYAnchor],
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 animations:^{ 121 animations:^{
122 [self.backgroundCircleView 122 [self.backgroundCircleView
123 setBackgroundColor:backgroundColor]; 123 setBackgroundColor:backgroundColor];
124 }]; 124 }];
125 } else { 125 } else {
126 [self.backgroundCircleView setBackgroundColor:backgroundColor]; 126 [self.backgroundCircleView setBackgroundColor:backgroundColor];
127 } 127 }
128 } 128 }
129 129
130 @end 130 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698