[ios] Replace all animation duration to default.

This commit is contained in:
v.mikhaylenko 2015-09-04 16:25:06 +03:00 committed by Alex Zolotarev
parent 747cdb28dc
commit 98a51d6c07
14 changed files with 35 additions and 25 deletions

View file

@ -15,6 +15,8 @@ static NSString * const kDownloadingProgressUpdateNotificationId = @"Downloading
static NSString * const kHaveAppleWatch = @"HaveAppleWatch";
static CGFloat const kDefaultAnimationDuration = .2;
static inline NSString * const kApplicationGroupIdentifier()
{
static NSString * const productionGroupIdentifier = @"group.mapsme.watchkit.production";

View file

@ -129,7 +129,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
CGFloat const scale = 1.1;
alert.transform = CGAffineTransformMakeScale(scale, scale);
}
[UIView animateWithDuration:.15 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.view.alpha = 1.;
alert.alpha = 1.;
@ -141,7 +141,7 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
- (void)closeAlertWithCompletion:(nullable CloseAlertCompletion)completion
{
MWMAlert * alert = self.view.subviews.firstObject;
[UIView animateWithDuration:.15 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
alert.alpha = 0.;
self.view.alpha = 0.;

View file

@ -218,7 +218,7 @@ static NSString * const kStatisticsEvent = @"Map download Alert";
}];
[self.dialogsTableView beginUpdates];
[self.dialogsTableView endUpdates];
[UIView animateWithDuration:0.05 animations:^
[UIView animateWithDuration:.05 animations:^
{
[self layoutSubviews];
}];
@ -239,7 +239,7 @@ static NSString * const kStatisticsEvent = @"Map download Alert";
}
completion:^(BOOL finished)
{
[UIView animateWithDuration:.3 animations:^{
[UIView animateWithDuration:kDefaultAnimationDuration animations:^{
[self.dialogsTableView beginUpdates];
[self.dialogsTableView.visibleCells enumerateObjectsUsingBlock:^(MWMDownloaderDialogCell * obj, NSUInteger idx, BOOL *stop)
{

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMDownloaderDialogHeader.h"
#import "MWMDownloadTransitMapAlert.h"
@ -38,7 +39,7 @@ static NSString * const kDownloaderDialogHeaderNibName = @"MWMDownloaderDialogHe
BOOL const currentState = sender.selected;
sender.selected = !currentState;
self.dividerView.hidden = currentState;
[UIView animateWithDuration:.15 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.expandImage.transform = sender.selected ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformIdentity;
}];

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMAPIBar.h"
#import "MWMAPIBarView.h"
#import "SearchView.h"
@ -42,7 +43,7 @@
[self.delegate.view insertSubview:self.rootView belowSubview:self.delegate.searchView];
self.rootView.width = self.delegate.view.width;
self.rootView.maxY = 0.0;
[UIView animateWithDuration:0.2 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.rootView.targetY = 0.0;
self.isVisible = YES;
@ -51,7 +52,7 @@
- (void)hideAnimated:(BOOL)animated
{
[UIView animateWithDuration:animated ? 0.2 : 0.0 animations:^
[UIView animateWithDuration:animated ? kDefaultAnimationDuration : 0.0 animations:^
{
self.rootView.targetY = -self.rootView.height;
self.isVisible = NO;

View file

@ -49,7 +49,7 @@ static CGFloat const kStatusbarHeight = 20.0;
- (void)layoutSubviews
{
[UIView animateWithDuration:0.2 animations:^
[UIView animateWithDuration:0.2f animations:^
{
if (!CGRectEqualToRect(self.frame, self.defaultFrame))
self.frame = self.defaultFrame;

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMCircularProgress.h"
#import "MWMNavigationDashboardEntity.h"
#import "MWMRoutePreview.h"
@ -77,7 +78,7 @@
{
[self layoutIfNeeded];
self.showGoButton = show;
[UIView animateWithDuration:0.2 animations:^{ [self layoutIfNeeded]; }];
[UIView animateWithDuration:kDefaultAnimationDuration animations:^{ [self layoutIfNeeded]; }];
}
#pragma mark - Properties

View file

@ -39,7 +39,7 @@
[self layoutIfNeeded];
self.state = state;
[self update];
[UIView animateWithDuration:0.3 animations:^{ [self layoutIfNeeded]; }];
[UIView animateWithDuration:0.2f animations:^{ [self layoutIfNeeded]; }];
}
- (void)layoutSubviews

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMBookmarkDescriptionViewController.h"
#import "MWMPlacePageViewManager.h"
#import "MWMPlacePage.h"
@ -106,7 +107,7 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState)
{
self.textView.hidden = NO;
self.textView.text = text;
[UIView animateWithDuration:0.2f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.webView.alpha = 0.;
self.textView.alpha = 1.;
@ -122,7 +123,7 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState)
{
self.webView.hidden = NO;
[self.webView loadHTMLString:text baseURL:nil];
[UIView animateWithDuration:0.2f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.webView.alpha = 1.;
self.textView.alpha = 0.;
@ -193,7 +194,7 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState)
return;
}
[self.iPadOwnerNavigationController setNavigationBarHidden:YES];
[UIView animateWithDuration:0.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.iPadOwnerNavigationController.view.height = self.realPlacePageHeight;
}

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMPlacePageNavigationBar.h"
#import "MWMiPhonePortraitPlacePage.h"
#import "MWMPlacePageViewManager.h"
@ -77,7 +78,7 @@ static inline CGPoint const dismissCenter(CGFloat xPosition)
- (void)dismiss
{
[UIView animateWithDuration:.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.center = dismissCenter(self.center.x);
}];
@ -85,7 +86,7 @@ static inline CGPoint const dismissCenter(CGFloat xPosition)
- (void)show
{
[UIView animateWithDuration:.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.center = openCenter(self.center.x);
}];

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMiPadPlacePage.h"
#import "MWMPlacePageViewManager.h"
#import "MWMPlacePageActionBar.h"
@ -77,7 +78,7 @@ static CGFloat const kBottomOffset = 12.;
NSUInteger const count = self.viewControllers.count;
CGFloat const height = count > 1 ? ((UIViewController *)self.viewControllers[count - 2]).view.height : 0.0;
[UIView animateWithDuration:0.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.view.height = height;
}
@ -119,7 +120,7 @@ static CGFloat const kBottomOffset = 12.;
- (void)show
{
UIView * view = self.navigationController.view;
[UIView animateWithDuration:0.2f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
view.minX = kLeftOffset;
view.alpha = 1.0;
@ -130,7 +131,7 @@ static CGFloat const kBottomOffset = 12.;
{
UIView * view = self.navigationController.view;
UIViewController * controller = self.navigationController;
[UIView animateWithDuration:0.2f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
view.maxX = 0.0;
view.alpha = 0.0;
@ -158,7 +159,7 @@ static CGFloat const kBottomOffset = 12.;
- (void)addBookmark
{
[super addBookmark];
[UIView animateWithDuration:0.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
[self updatePlacePageLayout];
}];
@ -167,7 +168,7 @@ static CGFloat const kBottomOffset = 12.;
- (void)removeBookmark
{
[super removeBookmark];
[UIView animateWithDuration:0.1 animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
[self updatePlacePageLayout];
}];
@ -278,7 +279,7 @@ static CGFloat const kBottomOffset = 12.;
- (void)setTopBound:(CGFloat)topBound
{
super.topBound = topBound;
[UIView animateWithDuration:0.2f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.navigationController.view.minY = topBound + kTopOffset;
}];

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMiPhoneLandscapePlacePage.h"
#import "MWMBasePlacePageView.h"
#import "MWMPlacePageActionBar.h"
@ -133,7 +134,7 @@ typedef NS_ENUM(NSUInteger, MWMiPhoneLandscapePlacePageState)
CGFloat const headerViewHeight = baseViewHeight - tableHeight;
CGFloat const titleOriginY = tableHeight - kBookmarkCellHeight - tableView.contentOffset.y;
[UIView animateWithDuration:0.3f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.basePlacePageView.transform = CGAffineTransformMakeTranslation(0., statusBarHeight - headerViewHeight - titleOriginY);
}];
@ -142,7 +143,7 @@ typedef NS_ENUM(NSUInteger, MWMiPhoneLandscapePlacePageState)
- (void)willFinishEditingBookmarkTitle:(NSString *)title
{
[super willFinishEditingBookmarkTitle:title];
[UIView animateWithDuration:0.3f animations:^
[UIView animateWithDuration:kDefaultAnimationDuration animations:^
{
self.basePlacePageView.transform = CGAffineTransformMakeTranslation(0., 0.);
}];

View file

@ -6,6 +6,7 @@
// Copyright (c) 2015 MapsWithMe. All rights reserved.
//
#import "Common.h"
#import "MWMiPhonePortraitPlacePage.h"
#import "MWMSpringAnimation.h"
#import "UIKitCategories.h"
@ -75,7 +76,7 @@ typedef NS_ENUM(NSUInteger, MWMiPhonePortraitPlacePageState)
self.actionBar.width = width;
self.actionBar.center = CGPointMake(width / 2., height + self.actionBar.height / 2.);
[self.manager addSubviews:@[ppv, self.actionBar] withNavigationController:nil];
[UIView animateWithDuration:0.3f delay:0. options:UIViewAnimationOptionCurveEaseOut animations:^
[UIView animateWithDuration:kDefaultAnimationDuration delay:0. options:UIViewAnimationOptionCurveEaseOut animations:^
{
self.actionBar.center = CGPointMake(width / 2., height - self.actionBar.height / 2.);
}

View file

@ -180,7 +180,7 @@ static BOOL keyboardLoaded = NO;
[self showDownloadMapRequestIfRequired];
if (keyboardLoaded && !self.downloadRequest)
[self.searchBar.textField becomeFirstResponder];
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
[UIView animateWithDuration:kDefaultAnimationDuration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.tableView.alpha = 1;
} completion:nil];
[UIView animateWithDuration:duration delay:0 damping:damping initialVelocity:0 options:options animations:^{