forked from organicmaps/organicmaps
[ios] Fixed spinner.
This commit is contained in:
parent
6987ba2347
commit
a346495efb
8 changed files with 13 additions and 13 deletions
|
@ -28,7 +28,7 @@ typedef NS_ENUM(NSInteger, MWMCircularProgressState)
|
|||
- (nonnull instancetype)init __attribute__((unavailable("init is not available")));
|
||||
- (nonnull instancetype)initWithParentView:(nonnull UIView *)parentView;
|
||||
- (void)reset;
|
||||
- (void)startSpinner;
|
||||
- (void)startSpinner:(BOOL)isInvert;
|
||||
- (void)stopSpinner;
|
||||
|
||||
@end
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
|
||||
#pragma mark - Spinner
|
||||
|
||||
- (void)startSpinner
|
||||
- (void)startSpinner:(BOOL)isInvert
|
||||
{
|
||||
[self reset];
|
||||
[self.rootView startSpinner];
|
||||
[self.rootView startSpinner:isInvert];
|
||||
}
|
||||
|
||||
- (void)stopSpinner
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
- (void)animateFromValue:(CGFloat)fromValue toValue:(CGFloat)toValue;
|
||||
|
||||
- (void)updatePath:(CGFloat)progress;
|
||||
- (void)startSpinner;
|
||||
- (void)startSpinner:(BOOL)isInvert;
|
||||
- (void)stopSpinner;
|
||||
|
||||
@end
|
||||
|
|
|
@ -144,7 +144,7 @@ static inline CGFloat angleWithProgress(CGFloat progress)
|
|||
|
||||
#pragma mark - Spinner
|
||||
|
||||
- (void)startSpinner
|
||||
- (void)startSpinner:(BOOL)isInvert
|
||||
{
|
||||
if (!self.spinner.hidden)
|
||||
return;
|
||||
|
@ -154,9 +154,9 @@ static inline CGFloat angleWithProgress(CGFloat progress)
|
|||
self.backgroundLayer.hidden = self.progressLayer.hidden = YES;
|
||||
NSUInteger const animationImagesCount = 12;
|
||||
NSMutableArray * animationImages = [NSMutableArray arrayWithCapacity:animationImagesCount];
|
||||
NSString * postfix = ([UIColor isNightMode] && !isInvert) || (![UIColor isNightMode] && isInvert) ? @"dark" : @"light";
|
||||
for (NSUInteger i = 0; i < animationImagesCount; ++i)
|
||||
animationImages[i] = [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i+1),
|
||||
[UIColor isNightMode] ? @"dark" : @"light"]];
|
||||
animationImages[i] = [UIImage imageNamed:[NSString stringWithFormat:@"Spinner_%@_%@", @(i+1), postfix]];
|
||||
|
||||
self.spinner.animationImages = animationImages;
|
||||
[self.spinner startAnimating];
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
if (progress.state == MWMCircularProgressStateFailed)
|
||||
{
|
||||
activeMapLayout.RetryDownloading(self.currentCountryIndex);
|
||||
[self.progressView startSpinner];
|
||||
[self.progressView startSpinner:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -138,7 +138,7 @@
|
|||
GetFramework().GetCountryTree().GetActiveMapLayout().DownloadMap(self.currentCountryIndex, MapOptions::MapWithCarRouting);
|
||||
self.progressView.progress = 0.0;
|
||||
[self showRequest];
|
||||
[self.progressView startSpinner];
|
||||
[self.progressView startSpinner:NO];
|
||||
}
|
||||
|
||||
- (IBAction)selectMapTouchUpInside:(nonnull UIButton *)sender
|
||||
|
|
|
@ -98,7 +98,7 @@ using namespace osm;
|
|||
{
|
||||
self.spinnerView.hidden = NO;
|
||||
self.spinner = [[MWMCircularProgress alloc] initWithParentView:self.spinnerView];
|
||||
[self.spinner startSpinner];
|
||||
[self.spinner startSpinner:YES];
|
||||
self.loginTextField.enabled = NO;
|
||||
self.passwordTextField.enabled = NO;
|
||||
self.forgotButton.enabled = NO;
|
||||
|
|
|
@ -115,7 +115,7 @@ NSString * getVerifier(NSString * urlString)
|
|||
{
|
||||
self.spinnerView.hidden = NO;
|
||||
self.spinner = [[MWMCircularProgress alloc] initWithParentView:self.spinnerView];
|
||||
[self.spinner startSpinner];
|
||||
[self.spinner startSpinner:YES];
|
||||
self.webView.userInteractionEnabled = NO;
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ extern NSString * const kTTSStatusWasChangedNotification;
|
|||
[self.routePreview selectProgress:progress];
|
||||
if (!self.delegate.isPossibleToBuildRoute)
|
||||
return;
|
||||
[progress startSpinner];
|
||||
[progress startSpinner:NO];
|
||||
[self.delegate buildRoute];
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ extern NSString * const kTTSStatusWasChangedNotification;
|
|||
[self removePanel:self.nextTurnPanel];
|
||||
// [self removePanel:self.lanesPanel];
|
||||
[self setupActualRoute];
|
||||
[self.activeRouteTypeButton startSpinner];
|
||||
[self.activeRouteTypeButton startSpinner:NO];
|
||||
}
|
||||
|
||||
- (void)showStateReady
|
||||
|
|
Loading…
Add table
Reference in a new issue