7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * The contents of this file are subject to the terms of the Common Development and
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * Distribution License (the License). You may not use this file except in compliance with the
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * specific language governing permission and limitations under the License.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * When distributing Covered Software, include this CDDL Header Notice in each file and include
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * Header, with the fields enclosed by brackets [] replaced by your own identifying
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * information: "Portions copyright [year] [name of copyright owner]".
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * Copyright 2016 ForgeRock AS.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni#import "FRAActivityIndicator.h"
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni@property (strong, nonatomic) UIBlurEffect *blurEffect;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni@property (strong, nonatomic) UIVisualEffectView *vibrancyView;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni@property (strong, nonatomic) UIActivityIndicatorView *activityIndicator;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni@property (strong, nonatomic) UILabel *label;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.vibrancyView = [[UIVisualEffectView alloc] initWithEffect:[UIVibrancyEffect effectForBlurEffect:self.blurEffect]];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self = [super initWithEffect:self.blurEffect];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [self.contentView addSubview:self.vibrancyView];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [self.vibrancyView.contentView addSubview:self.activityIndicator];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni [self.vibrancyView.contentView addSubview:self.label];
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni CGFloat width = self.superview.frame.size.width / 1.5;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.frame = CGRectMake(self.superview.frame.size.width / 2 - width / 2,
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.superview.frame.size.height / 2 - height / 2,
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni CGFloat activityIndicatorSize = (CGFloat)40;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.activityIndicator.frame = CGRectMake(5, height / 2 - activityIndicatorSize / 2,
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.label.textAlignment = NSTextAlignmentCenter;
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni self.label.frame = CGRectMake(activityIndicatorSize + 5, 0, width - activityIndicatorSize - 15, height);