OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/elements/activity_overlay_view_controller.h" |
| 6 |
| 7 #import "ios/chrome/browser/ui/material_components/activity_indicator.h" |
| 8 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 9 #import "ios/third_party/material_components_ios/src/components/ActivityIndicato
r/src/MaterialActivityIndicator.h" |
| 10 |
| 11 namespace { |
| 12 // Size of the activity indicator. |
| 13 const CGFloat kActivityIndicatorSize = 48; |
| 14 // Alpha of the presented view's background. |
| 15 const CGFloat kBackgroundAlpha = 0.5; |
| 16 } |
| 17 |
| 18 @implementation ActivityOverlayViewController |
| 19 |
| 20 - (void)viewDidLoad { |
| 21 [super viewDidLoad]; |
| 22 self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:kBackgroundAlpha]; |
| 23 |
| 24 MDCActivityIndicator* activityIndicator = [[[MDCActivityIndicator alloc] |
| 25 initWithFrame:CGRectMake(0, 0, kActivityIndicatorSize, |
| 26 kActivityIndicatorSize)] autorelease]; |
| 27 activityIndicator.translatesAutoresizingMaskIntoConstraints = NO; |
| 28 [self.view addSubview:activityIndicator]; |
| 29 AddSameCenterConstraints(self.view, activityIndicator); |
| 30 activityIndicator.cycleColors = ActivityIndicatorBrandedCycleColors(); |
| 31 [activityIndicator startAnimating]; |
| 32 } |
| 33 |
| 34 @end |
OLD | NEW |