From ea7ee91949decb6893a9ffb2de5770824e5025ef Mon Sep 17 00:00:00 2001 From: Alexey Yachmenev Date: Thu, 10 Sep 2015 12:20:38 +0300 Subject: [PATCH 1/4] fix crash when a small change in progress --- src/Components/MRCircularProgressView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/MRCircularProgressView.m b/src/Components/MRCircularProgressView.m index 293d676..c622e03 100644 --- a/src/Components/MRCircularProgressView.m +++ b/src/Components/MRCircularProgressView.m @@ -199,7 +199,7 @@ - (void)updateLabel:(float)progress { - (void)setProgress:(float)progress animated:(BOOL)animated { if (animated) { - if (ABS(self.progress - progress) < CGFLOAT_MIN) { + if (ABS(self.progress - progress) * 100 < 1) { return; } From a61a7bc428848bd72abde3b96f04a9de33fa12bd Mon Sep 17 00:00:00 2001 From: Alexey Yachmenev Date: Mon, 5 Oct 2015 18:45:18 +0300 Subject: [PATCH 2/4] add activity indicator running size --- src/Components/MRActivityIndicatorView.h | 2 ++ src/Components/MRActivityIndicatorView.m | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Components/MRActivityIndicatorView.h b/src/Components/MRActivityIndicatorView.h index 59de56d..e0f28da 100644 --- a/src/Components/MRActivityIndicatorView.h +++ b/src/Components/MRActivityIndicatorView.h @@ -22,6 +22,8 @@ #pragma clang diagnostic pop } +@property (nonatomic, assign) float runnerSize; + /** A float value to indicate how thick the line of the activivity indicator is. diff --git a/src/Components/MRActivityIndicatorView.m b/src/Components/MRActivityIndicatorView.m index 8e972df..f292862 100644 --- a/src/Components/MRActivityIndicatorView.m +++ b/src/Components/MRActivityIndicatorView.m @@ -51,7 +51,8 @@ - (void)commonInit { self.accessibilityLabel = NSLocalizedString(@"Indeterminate Progress", @"Accessibility label for activity indicator view"); self.hidesWhenStopped = YES; - + self.runnerSize = 0.9; + CAShapeLayer *shapeLayer = [CAShapeLayer new]; shapeLayer.borderWidth = 0; shapeLayer.fillColor = UIColor.clearColor.CGColor; @@ -118,11 +119,12 @@ - (void)layoutSubviews { - (UIBezierPath *)layoutPath { const double TWO_M_PI = 2.0*M_PI; double startAngle = 0.75 * TWO_M_PI; - double endAngle = startAngle + TWO_M_PI * 0.9; + double endAngle = startAngle + TWO_M_PI * self.runnerSize; CGFloat width = self.bounds.size.width; + CGFloat lineWidth = self.lineWidth; return [UIBezierPath bezierPathWithArcCenter:CGPointMake(width/2.0f, width/2.0f) - radius:width/2.2f + radius:(width - lineWidth)/2.0f startAngle:startAngle endAngle:endAngle clockwise:YES]; From ec895a0fc05dc4f8c33073a79658052bcd418fd5 Mon Sep 17 00:00:00 2001 From: Alexey Yachmenev Date: Tue, 24 Nov 2015 13:09:58 +0300 Subject: [PATCH 3/4] correct activity indicator speed --- src/Components/MRActivityIndicatorView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/MRActivityIndicatorView.m b/src/Components/MRActivityIndicatorView.m index f292862..af1c515 100644 --- a/src/Components/MRActivityIndicatorView.m +++ b/src/Components/MRActivityIndicatorView.m @@ -207,7 +207,7 @@ - (void)addAnimation { CABasicAnimation *spinAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; spinAnimation.toValue = @(1*2*M_PI); spinAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; - spinAnimation.duration = 1.0; + spinAnimation.duration = 1.2; spinAnimation.repeatCount = INFINITY; [self.shapeLayer addAnimation:spinAnimation forKey:MRActivityIndicatorViewSpinAnimationKey]; } From c2dc8e61f9b08eeb955b08ff9010958aa308e3c0 Mon Sep 17 00:00:00 2001 From: Arthur Semenyutin Date: Wed, 13 Jan 2016 19:51:43 +0300 Subject: [PATCH 4/4] disable MRRotationForStatusBarOrientation in ios extension --- src/Utils/MRProgressHelper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/MRProgressHelper.h b/src/Utils/MRProgressHelper.h index 0213170..398fbf3 100644 --- a/src/Utils/MRProgressHelper.h +++ b/src/Utils/MRProgressHelper.h @@ -37,7 +37,7 @@ static inline CGRect MRCenterCGSizeInCGRect(CGSize innerRectSize, CGRect outerRe } -static inline CGFloat MRRotationForStatusBarOrientation() { +static inline CGFloat MRRotationForStatusBarOrientation() NS_EXTENSION_UNAVAILABLE_IOS("Status bar orientation is not available in extensions.") { UIInterfaceOrientation orientation = UIApplication.sharedApplication.statusBarOrientation; if (orientation == UIInterfaceOrientationLandscapeLeft) { return -M_PI_2;