From d17622244e88ced212ad6c2fd895a23d2e99da0a Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Tue, 29 Nov 2016 18:24:23 +0300 Subject: [cleanup] [ios] Removed obsolete code. --- iphone/Maps/Classes/Search/MWMSearch.mm | 3 - iphone/Maps/Classes/ToastView.h | 9 --- iphone/Maps/Classes/ToastView.mm | 90 ------------------------------ iphone/Maps/Maps.xcodeproj/project.pbxproj | 7 --- 4 files changed, 109 deletions(-) delete mode 100644 iphone/Maps/Classes/ToastView.h delete mode 100644 iphone/Maps/Classes/ToastView.mm diff --git a/iphone/Maps/Classes/Search/MWMSearch.mm b/iphone/Maps/Classes/Search/MWMSearch.mm index c75e6d432e..c32d8ac5cb 100644 --- a/iphone/Maps/Classes/Search/MWMSearch.mm +++ b/iphone/Maps/Classes/Search/MWMSearch.mm @@ -4,7 +4,6 @@ #import "MWMAlertViewController.h" #import "MWMLocationManager.h" #import "MWMSearchHotelsFilterViewController.h" -#import "ToastView.h" #include "Framework.h" @@ -275,8 +274,6 @@ using TObservers = NSHashTable<__kindof TObserver>; - (void)onSearchCompleted { - if (self.searchOnMap && m_results.GetCount() == 0) - [[[ToastView alloc] initWithMessage:L(@"search_not_found_query")] show]; for (TObserver observer in self.observers) { if ([observer respondsToSelector:@selector(onSearchCompleted)]) diff --git a/iphone/Maps/Classes/ToastView.h b/iphone/Maps/Classes/ToastView.h deleted file mode 100644 index 5377c7d772..0000000000 --- a/iphone/Maps/Classes/ToastView.h +++ /dev/null @@ -1,9 +0,0 @@ - -#import - -@interface ToastView : UIView - -- (instancetype)initWithMessage:(NSString *)message; -- (void)show; - -@end diff --git a/iphone/Maps/Classes/ToastView.mm b/iphone/Maps/Classes/ToastView.mm deleted file mode 100644 index d883618afe..0000000000 --- a/iphone/Maps/Classes/ToastView.mm +++ /dev/null @@ -1,90 +0,0 @@ -#import "NSString+Categories.h" -#import "ToastView.h" -#import "UIColor+MapsMeColor.h" - -@interface ToastView () - -@property (nonatomic) UILabel * messageLabel; -@property (nonatomic) NSTimer * timer; - -@end - -@implementation ToastView - -- (id)initWithMessage:(NSString *)message -{ - CGFloat const xOffset = 18; - CGFloat const yOffset = 12; - CGSize textSize = [message sizeWithDrawSize:CGSizeMake(245 - 2 * xOffset, 1000) font:self.messageLabel.font]; - - self = [super initWithFrame:CGRectMake(0, 0, textSize.width + 2 * xOffset, textSize.height + 2 * yOffset)]; - self.backgroundColor = [UIColor pressBackground]; - self.layer.cornerRadius = 4; - self.layer.masksToBounds = NO; - self.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin; - - [self addSubview:self.messageLabel]; - self.messageLabel.frame = CGRectMake(xOffset, yOffset - 1, textSize.width, textSize.height); - self.messageLabel.text = message; - - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; - [self addGestureRecognizer:tap]; - - return self; -} - -- (UILabel *)messageLabel -{ - if (!_messageLabel) - { - _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; - _messageLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:12.5]; - _messageLabel.textAlignment = NSTextAlignmentCenter; - _messageLabel.textColor = [UIColor blackPrimaryText]; - _messageLabel.numberOfLines = 0; - _messageLabel.lineBreakMode = NSLineBreakByWordWrapping; - } - return _messageLabel; -} - -- (void)tap:(UITapGestureRecognizer *)sender -{ - [self hide]; -} - -- (void)timerSel:(id)sender -{ - [self hide]; -} - -- (void)hide -{ - [UIView animateWithDuration:0.3 animations:^{ - self.alpha = 0; - } completion:^(BOOL finished){ - [self removeFromSuperview]; - }]; -} - -- (void)show -{ - UIWindow * mainWindow = [[UIApplication sharedApplication].windows firstObject]; - UIWindow * window = [[mainWindow subviews] firstObject]; - [window addSubview:self]; - - self.midX = window.width / 2; - self.maxY = window.height - 68; - self.alpha = 0; - [UIView animateWithDuration:0.3 animations:^{ - self.alpha = 1; - }]; - - self.timer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(timerSel:) userInfo:nil repeats:NO]; -} - -- (void)dealloc -{ - [self.timer invalidate]; -} - -@end diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 4bb8837e34..9771dae305 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -534,7 +534,6 @@ 6741A9C01BF340DE002C974C /* MWMTextView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6588E2B1B15C26700EE1E58 /* MWMTextView.mm */; }; 6741A9C31BF340DE002C974C /* MWMPlacePageActionBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6CB21671AEFC6AA00FB8963 /* MWMPlacePageActionBar.mm */; }; 6741A9C61BF340DE002C974C /* MWMSearchCommonCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B82ADC1B84A4A000180497 /* MWMSearchCommonCell.mm */; }; - 6741A9C91BF340DE002C974C /* ToastView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 974386DC19373EA400FD5659 /* ToastView.mm */; }; 6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3438CDFB1B862F5C0051AA78 /* MWMSearchContentView.mm */; }; 6741A9CC1BF340DE002C974C /* MWMSearchTableViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */; }; 6741A9CE1BF340DE002C974C /* MWMSearchManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CFFE8A1B7DE6FD009D0C9F /* MWMSearchManager.mm */; }; @@ -1900,8 +1899,6 @@ 84DBC4C21D81B1B100CC1804 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = ""; }; 8D1107310486CEB800E47090 /* MAPSME.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MAPSME.plist; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 972CDCC51887F1B7006641CA /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; - 974386DB19373EA400FD5659 /* ToastView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToastView.h; sourceTree = ""; }; - 974386DC19373EA400FD5659 /* ToastView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ToastView.mm; sourceTree = ""; }; 9747264118323080006B7CB7 /* UIKitCategories.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UIKitCategories.mm; path = Categories/UIKitCategories.mm; sourceTree = ""; }; 9747264218323080006B7CB7 /* UIKitCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIKitCategories.h; path = Categories/UIKitCategories.h; sourceTree = ""; }; 9747278218338F0C006B7CB7 /* UIViewController+Navigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+Navigation.h"; path = "Classes/UIViewController+Navigation.h"; sourceTree = ""; }; @@ -3359,8 +3356,6 @@ 34EB84501C0738D30004689F /* Editor */, 349A35741B53D4C9009677EE /* CircularProgress */, 34BC72091B0DECAE0012A34B /* MapViewControls */, - 974386DB19373EA400FD5659 /* ToastView.h */, - 974386DC19373EA400FD5659 /* ToastView.mm */, ED48BBB317C267F5003E7E92 /* ColorPickerView.h */, ED48BBB417C267F5003E7E92 /* ColorPickerView.mm */, ED48BBB817C2B1E2003E7E92 /* CircleView.h */, @@ -4689,7 +4684,6 @@ 340C20E31C3E565600111D22 /* MWMCuisineEditorViewController.mm in Sources */, 3499C6861D51D3A600A1048A /* UIButton+Orientation.mm in Sources */, 34B82ADE1B84A4A000180497 /* MWMSearchCommonCell.mm in Sources */, - 974386DD19373EA400FD5659 /* ToastView.mm in Sources */, 34BBB71E1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */, 347FD8771C60B2CE002FB65E /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */, 342EE4111C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */, @@ -4938,7 +4932,6 @@ 34E273261C73876500463965 /* MWMMigrationView.mm in Sources */, 340C20E41C3E565600111D22 /* MWMCuisineEditorViewController.mm in Sources */, F653CE191C71F62700A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */, - 6741A9C91BF340DE002C974C /* ToastView.mm in Sources */, 3499C6871D51D3A700A1048A /* UIButton+Orientation.mm in Sources */, 6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */, 34BBB71F1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */, -- cgit v1.2.3